# Local First Tistory
Do not be afraid of shutting down blog server.
It will help you organize the posts in `local-first, server-last` rules.
## Why Use This?
If you've ever been in trouble when the blog server were shut down,
(especially the one is big-tech and never expecting abnormal!) this script just
for you.
You will hold all the data in the local and the script will manage all the things
to communicate with the server. You can read the data when you
(or the server π) are offline or migrate to the other platforms.
## Table of Contents
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Markdown](#markdown)
- [Image](#image)
- [Miscellaneous](#miscellaneous)
### Installation
- Python >= 3.9
- To install package:
```bash
pip install local-first-tistory
```
### Quick Start
You can use `local-first-tistory` using `$ tistory [command]`.
To start off, you run:
```bash
tistory init
```
It will handle 3 things:
- [Authorization](#authorization)
- [Create Default Directory](#default-directory)
- [Create Category Directory](#category-directory)
#### Authorization
You will see prompts and please follow the instructions.
To get `App ID` and `Secret Key`:
1. Go to `https://www.tistory.com/guide/api/manage/register`
1. Fill out your form.
Please be aware of `CallBack` column to `{blog_name}.tistory.com`,
not `http://{blog_name}.tistory.com`, `https://~` nor `https://www.~`.
![retrieve_app_id_and_secret_key](https://github.com/choikangjae/local-first-tistory/assets/99468424/4859388a-6670-4b0b-a2ed-6a4111a03ad1)
1. Now you get `App ID` and `Secret Key`. You can check `CallBack` column
and if it doesn't follow the `{blog_name}.tistory.com`, you can modify it here.
![result_app_id_and_secret_key](https://github.com/choikangjae/local-first-tistory/assets/99468424/204c4c0e-cccb-455f-940d-f6b3632ba2c2)
1. Enter `App ID` and `Secret key` while following the prompts.
1. All the data you input will be stored at `$HOME/.tistory/.env`.
If anything went wrong, you can modify the data manually.
#### Default Directory
It will be done automatically. You can check the default directory:
```bash
tree -a ~/.tistory
$HOME/.tistory
βββ .categories.toml
βββ .env
βββ .metadata.toml
βββ images
βββ markdowns
```
#### Category Directory
It will create directories according to your categories from blog automatically.
```bash
tree -a ~/.tistory/markdowns
$HOME/.tistory/markdowns
βββ category1
βββ category2
βΒ Β βββ category3
βΒ Β Β βββ category4
βββ category5
```
#### Help
`$ tistory` or `$ tistory --help`.
### Markdown
#### Markdown Location
You put all your markdown in `$HOME/.tistory/markdowns/{your_category}`.
#### Upload Markdowns
```bash
tistory md
```
It will detect all the modified or create file and upload it.
#### Write Markdown
Put the meta data on very top of the `markdown` file like:
```md
---
title or t or μ λͺ©: your_title [Mandatory]
visibility or vis or v or 곡κ°: [Optional]
published: TIMESTAMP (default: current_time) [Optional]
tag or tags or νκ·Έ: tag1,tag2,tag3 (default: '') [Optional]
acceptComment or ac or comment or λκΈ: [Optional]
---
Your Content starts from here
```
- `visibility` (default: `private`):
- `public`: `public` or `3` or `곡κ°`
- `protected`: `protected` or `1` or `보νΈ`
- `private`: `private` or `0` or `λΉκ³΅κ°`
- `acceptComment` (default: `yes`):
- To accept: `yes` or `y` or `true` or `t` or `νμ©` or `1`
- To deny: `no` or `n` or `false` or `f` or `κ±°λΆ` or `0`
You will notice that only title is mandatory and not the others. This is the example:
```md
# markdowns/category/example.md
---
t: This is my first article!
v: public
ac: νμ©
tag: my article,first issue
---
And here it is article content!
```
For more information, go to [official API](https://tistory.github.io/document-tistory-apis/apis/v1/post/write.html).
### Image
#### Image Location
Put your images you want to upload in `$HOME/.tistory/images/`.
#### Upload Images
- Make sure images extension end with `.png`, `.jpg`, `.jpeg` or `.gif`.
- Run:
```bash
tistory img
```
- Uploaded image url will be stored at `$HOME/.tistory/.images.toml`
and you can use `url` when writing markdown.
- Recommend to upload images first before writing your markdowns
since you need `url` in `![images](url)`.
### Miscellaneous
#### Category
If you updated category from your blog and to upgrade it:
```bash
tistory category
```
#### Reauthorization
If something went wrong while `tistory init`, you can do authorization step independently:
```bash
tistory auth
```
Or you can modify the field at `$HOME/.tistory/.env` manually.
Raw data
{
"_id": null,
"home_page": "https://github.com/choikangjae/local-first-tistory",
"name": "local-first-tistory",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "tistory terminal markdown image",
"author": "Kangjae Choi",
"author_email": "choikj33@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/00/34/f49121a6ce3383e7f8872d2e62f8785296393bcd17e1ff641c8bad90912c/local-first-tistory-0.0.2.tar.gz",
"platform": null,
"description": "# Local First Tistory\n\nDo not be afraid of shutting down blog server.\nIt will help you organize the posts in `local-first, server-last` rules.\n\n## Why Use This?\n\nIf you've ever been in trouble when the blog server were shut down,\n(especially the one is big-tech and never expecting abnormal!) this script just\nfor you.\n\nYou will hold all the data in the local and the script will manage all the things\nto communicate with the server. You can read the data when you\n(or the server \ud83d\ude02) are offline or migrate to the other platforms.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Markdown](#markdown)\n- [Image](#image)\n- [Miscellaneous](#miscellaneous)\n\n### Installation\n\n- Python >= 3.9\n- To install package:\n\n ```bash\n pip install local-first-tistory\n ```\n\n### Quick Start\n\nYou can use `local-first-tistory` using `$ tistory [command]`.\n\nTo start off, you run:\n\n```bash\ntistory init\n```\n\nIt will handle 3 things:\n\n- [Authorization](#authorization)\n- [Create Default Directory](#default-directory)\n- [Create Category Directory](#category-directory)\n\n#### Authorization\n\nYou will see prompts and please follow the instructions.\n\nTo get `App ID` and `Secret Key`:\n\n1. Go to `https://www.tistory.com/guide/api/manage/register`\n\n1. Fill out your form.\n\n Please be aware of `CallBack` column to `{blog_name}.tistory.com`,\n not `http://{blog_name}.tistory.com`, `https://~` nor `https://www.~`.\n\n ![retrieve_app_id_and_secret_key](https://github.com/choikangjae/local-first-tistory/assets/99468424/4859388a-6670-4b0b-a2ed-6a4111a03ad1)\n\n1. Now you get `App ID` and `Secret Key`. You can check `CallBack` column\nand if it doesn't follow the `{blog_name}.tistory.com`, you can modify it here.\n ![result_app_id_and_secret_key](https://github.com/choikangjae/local-first-tistory/assets/99468424/204c4c0e-cccb-455f-940d-f6b3632ba2c2)\n\n1. Enter `App ID` and `Secret key` while following the prompts.\n\n1. All the data you input will be stored at `$HOME/.tistory/.env`.\nIf anything went wrong, you can modify the data manually.\n\n#### Default Directory\n\nIt will be done automatically. You can check the default directory:\n\n```bash\ntree -a ~/.tistory \n\n$HOME/.tistory\n\u251c\u2500\u2500 .categories.toml\n\u251c\u2500\u2500 .env\n\u251c\u2500\u2500 .metadata.toml\n\u251c\u2500\u2500 images\n\u2514\u2500\u2500 markdowns\n```\n\n#### Category Directory\n\nIt will create directories according to your categories from blog automatically.\n\n```bash\ntree -a ~/.tistory/markdowns \n\n$HOME/.tistory/markdowns\n\u251c\u2500\u2500 category1\n\u251c\u2500\u2500 category2\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 category3\n\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 category4\n\u2514\u2500\u2500 category5\n```\n\n#### Help\n\n`$ tistory` or `$ tistory --help`.\n\n### Markdown\n\n#### Markdown Location\n\nYou put all your markdown in `$HOME/.tistory/markdowns/{your_category}`.\n\n#### Upload Markdowns\n\n```bash\ntistory md\n```\n\nIt will detect all the modified or create file and upload it.\n\n#### Write Markdown\n\nPut the meta data on very top of the `markdown` file like:\n\n```md\n---\ntitle or t or \uc81c\ubaa9: your_title [Mandatory]\nvisibility or vis or v or \uacf5\uac1c: [Optional]\npublished: TIMESTAMP (default: current_time) [Optional]\ntag or tags or \ud0dc\uadf8: tag1,tag2,tag3 (default: '') [Optional]\nacceptComment or ac or comment or \ub313\uae00: [Optional]\n---\n\nYour Content starts from here\n```\n\n- `visibility` (default: `private`):\n - `public`: `public` or `3` or `\uacf5\uac1c`\n - `protected`: `protected` or `1` or `\ubcf4\ud638`\n - `private`: `private` or `0` or `\ube44\uacf5\uac1c`\n- `acceptComment` (default: `yes`):\n - To accept: `yes` or `y` or `true` or `t` or `\ud5c8\uc6a9` or `1`\n - To deny: `no` or `n` or `false` or `f` or `\uac70\ubd80` or `0`\n\nYou will notice that only title is mandatory and not the others. This is the example:\n\n```md\n# markdowns/category/example.md\n\n---\nt: This is my first article!\nv: public\nac: \ud5c8\uc6a9\ntag: my article,first issue\n---\n\nAnd here it is article content!\n```\n\nFor more information, go to [official API](https://tistory.github.io/document-tistory-apis/apis/v1/post/write.html).\n\n### Image\n\n#### Image Location\n\nPut your images you want to upload in `$HOME/.tistory/images/`.\n\n#### Upload Images\n\n- Make sure images extension end with `.png`, `.jpg`, `.jpeg` or `.gif`.\n\n- Run:\n\n ```bash\n tistory img\n ```\n\n- Uploaded image url will be stored at `$HOME/.tistory/.images.toml`\nand you can use `url` when writing markdown.\n\n- Recommend to upload images first before writing your markdowns\nsince you need `url` in `![images](url)`.\n\n### Miscellaneous\n\n#### Category\n\nIf you updated category from your blog and to upgrade it:\n\n```bash\ntistory category\n```\n\n#### Reauthorization\n\nIf something went wrong while `tistory init`, you can do authorization step independently:\n\n```bash\ntistory auth\n```\n\nOr you can modify the field at `$HOME/.tistory/.env` manually.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "It will help you to manage locally saved markdown to upload to Tistory",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/choikangjae/local-first-tistory"
},
"split_keywords": [
"tistory",
"terminal",
"markdown",
"image"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "295e46258b2bda3e6b67f583b22edf5d89aace57989c2c29cb62db1e26c7458d",
"md5": "8f5fe48e714a56b1591e7a2481555079",
"sha256": "56497db81b33bdfb615acf9155814ac713fc322e85f3a63ec6ff8d4b9b2820d3"
},
"downloads": -1,
"filename": "local_first_tistory-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8f5fe48e714a56b1591e7a2481555079",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10674,
"upload_time": "2023-06-22T17:49:24",
"upload_time_iso_8601": "2023-06-22T17:49:24.426488Z",
"url": "https://files.pythonhosted.org/packages/29/5e/46258b2bda3e6b67f583b22edf5d89aace57989c2c29cb62db1e26c7458d/local_first_tistory-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0034f49121a6ce3383e7f8872d2e62f8785296393bcd17e1ff641c8bad90912c",
"md5": "b12ab120e035261d238b5c5e0144381f",
"sha256": "b0f81fa4e879306135de2edfe949f7e8b245d891b5a4c89bf7b53d50cbbb3106"
},
"downloads": -1,
"filename": "local-first-tistory-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "b12ab120e035261d238b5c5e0144381f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8459,
"upload_time": "2023-06-22T17:49:29",
"upload_time_iso_8601": "2023-06-22T17:49:29.066533Z",
"url": "https://files.pythonhosted.org/packages/00/34/f49121a6ce3383e7f8872d2e62f8785296393bcd17e1ff641c8bad90912c/local-first-tistory-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-22 17:49:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "choikangjae",
"github_project": "local-first-tistory",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "local-first-tistory"
}