{"_id":"@david.casillas/writer-chapter-tool","_rev":"1-6b042af720855d26f74fbb1e76bd55d1","name":"@david.casillas/writer-chapter-tool","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@david.casillas/writer-chapter-tool","version":"1.0.0","description":"Command line utility to manage a writing split in chapter files.","bin":{"wct":"bin/index.js"},"scripts":{"test":"jest"},"repository":{"type":"git","url":"git+https://github.com/DavidCasillasRivero/writer-chapter-tool.git"},"author":{"name":"David Casillas Rivero","email":"davidquintu@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/DavidCasillasRivero/writer-chapter-tool/issues"},"homepage":"https://github.com/DavidCasillasRivero/writer-chapter-tool#readme","devDependencies":{"jest":"^24.9.0"},"dependencies":{"conf":"^6.2.0"},"gitHead":"ff2c78aee30ec81827b06c359d48fad8af729d4c","_id":"@david.casillas/writer-chapter-tool@1.0.0","_nodeVersion":"12.10.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-hqQ9worJmpFaZRZ1T37SjzbAa/VheJHrpvxoio3Xe+Ck6TfyVn/HFnX1U438PKjUnBVwrFZYEp8XjfRV+JmUsA==","shasum":"22466a203e99579ed829cc72a3d201549387298c","tarball":"https://registry.npmjs.org/@david.casillas/writer-chapter-tool/-/writer-chapter-tool-1.0.0.tgz","fileCount":12,"unpackedSize":40491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVOXiCRA9TVsSAnZWagAA7mAQAI6MIhOlYHhxBDn0vysj\n76fizH7f1dKaXjYyU7FIH69pbtgX1aCwY9tViLkRlMQlGf7RRMzBvxIgYtzl\nCMs1tFKNB5p6Z0wEOluZ8O5SOA4JGXXgt5CtBtJIEpJ4n2n7a4Clw4Y2mUXz\nhPvjnPkHr59huMSU5GrdtfmN/tumlNTUCbk/6RD7iOHU/etCRgsw3TUOB6UZ\ndWtmzDhZqAcMx6rAl1sa/CJUde2KDlKOuACve8yDckt22YiD7YRtny+6KkSt\nckhVWNp81P/Guvvm7hvq2Rt+SE3qdbFGluSjJMcZOnrySF6mHJM6C0P7drLH\nIAXP4UMIS2tr56Yge/0VWj6xSMTJTeGorn2mcX60VLndVR3fPUvmEZR44PQT\nQvkMHbngIJYoIYp1fymFlFnhYUH4206yJvYD7Hy0gyLt2qU39V4vYrTGmRDg\nSkTtaCH9O0xDDnXWphKexaTZA4XaZyBJ42KhUcn0qJjcXaHq5KPYNd52M9w3\nIke0XiI1OOPBbq2D23N5fXCYxLVzkuT2TYOBgUiJJ3hyA+TUpFW1UoWJiZmS\ny02p+T1TZn+6aqNs4L4AMXjt/tYA1iTSToxxIm7C9f6TJSGvTNpuAKUz8u72\nmxtYDGI8l/2TC69yUynT3ScdoctLpTTSjOt7sqKQo45fsihln/ZbxWE05rHN\n1v4t\r\n=Vb0C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQComNi8AtXwKVf83oNizAcNT6fwMo61T4blMVR2f9LaUAIhAOkJ8kiMDr/bXhRp6YbVWQh7IB/i199R1ri3GJLX17XO"}]},"maintainers":[{"name":"david.casillas","email":"davidquintu@gmail.com"}],"_npmUser":{"name":"david.casillas","email":"davidquintu@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/writer-chapter-tool_1.0.0_1582622177535_0.1953722979470578"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-25T09:16:17.493Z","1.0.0":"2020-02-25T09:16:17.731Z","modified":"2022-04-05T03:05:28.885Z"},"maintainers":[{"name":"david.casillas","email":"davidquintu@gmail.com"}],"description":"Command line utility to manage a writing split in chapter files.","homepage":"https://github.com/DavidCasillasRivero/writer-chapter-tool#readme","repository":{"type":"git","url":"git+https://github.com/DavidCasillasRivero/writer-chapter-tool.git"},"author":{"name":"David Casillas Rivero","email":"davidquintu@gmail.com"},"bugs":{"url":"https://github.com/DavidCasillasRivero/writer-chapter-tool/issues"},"license":"MIT","readme":"# writer-chapter-tool\n\nCommand line utility to manage a lightweight markup writing (markdown for example) split in chapter files.\n\n## Prerrequisites\n\nThis is a Node.js tool, so you need to have installed it in your system. [Download & Install Node.js](https://nodejs.org/en/download/) and the npm package manager.\n\n## Geting started\n\n\n### Installing\n\nInstall this package globally to have access to the command line cli.\n\n```shell\n$ npm install -g @david.casillas/writer-chapter-tool\n```\n\n### Configuring\n\nBy default the tool is configured to work with markdown files, this affects the file extension and the format of the headings inserted in every new chapter file created. There is a config option to change the syntax used, but by now only markdown is supported.\n\n```shell\n$ wct config-set language markdown\n```\n\nThere are 2 options to control the editor used to open chapter files and the preview tool. Set then to your favourite apps using:\n\n```shell\n$ wct config-set editor BBEdit\n$ wct config-set editor Markdown\n```\n\nTo check the current available options:\n\n```shell\n$ wct config-list\n```\n\nAll options are global and will affect all your projects. There is still no local per project settings.\n\n## How to use\n\nAfter installation create a folder to start your project. The folder will start empty.\n\n```shell\n$ mkdir mybook\n$ cd mybook\n```\n\n### Creating chapters\n\nStart your book creating your first chapter. Since there was nothing created before this will create folders `src` and `src/images` in your project folder.\n\n```shell\n$ wct chapter-create 'Starting here'\n````\n\nNow a markdown file for the content of the chapter and a folder `src/images/00` to hold the images will be created. Let's see the contents of the project `src`  folder right know:\n\n```shell\n$ ls -la src\n\n.\n|- 00-Starting here.md\n|- images\n|---- 00\n\n```\n\nThe markdown file contains the header of the chapter:\n\n```shell\n$ cat src/00-Starting here.md\n\n## Starting here\n```\n\nLet's create another chapter.\n\n```shell\n$ wct chapter-create 'Other chapter'\n````\n\nThis will add another chapter, increasing the chapter number. The first chapter is chapter 0.\n\n```shell\n$ ls -la src\n\n.\n|- 00-Starting here.md\n|- 01-Other chapter.md\n|- images\n|---- 00\n|---- 01\n```\n\n### Managing chapters\n\nWe can see a list of chapters with the `list` command.\n\n```shell\n$ wct chapter-list\n\n00-Starting here\n01-Other chapter\n```\n\nLet's rename a chapter and change its position in the book.\n\n```shell\n$ wct chapter-rename 1 'Now I'm the first chapter'\n$ wct chapter-move 1 0\n$ wct chapter-list\n\n00-Now I'm the first chapter\n01-Starting here\n```\n\nNow what was chapter number 1 is now in the 0 position and has been renamed.\n\nWe can delete a chapter, ¡be sure to be using version control, since this can not be undone!\n\n```shell\n$ wct chapter-delete 0\n$ wct chapter-list\n\n00-Starting here\n```\n\nAs you can see deleting a chapter reindexes the rest of chapters so they range from 0 to the last chapter.\n\n### Adding content to chapters\n\nFinally to start writing on a chapter:\n\n```shell\n$ wct chapter-edit 0\n```\n\nBy default the `edit` command opens the markdown file in BBEdit editor to edit it and in Marked to have a live preview of the content. Check the config section to change the applications used to edit and preview.\n\nIn case you need to add images to your document copy the image file in the apropiate folder under `src/images` matching the chapter number. Then in your document reference the image. Here is an example using markdown syntax.\n\n```markdown\n[images/00/my-image.jpg]()\n```\n\n### Preview the book\n\nThe command `preview` merges the contents of the `src` folder into a single markdown file and copies it to the `build` folder. The `images` folder is copied as is from `src` to `build` so all images keep working with no modification.\n\nThe command also opens the result in the application configured to preview the content.\n\n\n## API\n\nThis is a full list of all API commands available:\n\n- `mwt chapter-create <chapter_title>`\n- `mwt chapter-move <old_chapter_number> <new_chapter_number>`\n- `mwt chapter-delete <chapter_number>`\n- `mwt chapter-edit <chapter_number>`\n- `mwt chapter-rename <chapter_number> <new_title>`\n- `mwt chapter-list`\n- `mwt book-compile`\n- `mwt config-list`\n- `mwt config-set <property> <value>`\n\n### API shortcuts\n\nCommands have a shortcut build from the first letter of every command name part. For example the command `mwt chapter-list` can be written as `wct cl`.\n\nConfig commands do not have a shortcut.\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n","readmeFilename":"README.md"}