diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-05-22 12:54:42 +0100 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-05-22 12:54:42 +0100 |
| commit | 4bbe114c1a859acd12f1dfdcdb04c53ba2d1dc0b (patch) | |
| tree | 4599a2e8d28902e1da24de4309f7e350c2e73cd9 /www/posts/markdown/atom.xml | |
| parent | 7eb2bef6469ad5730099d55858ed37183d06ccc6 (diff) | |
Ensure html is valid in atom feeds
Diffstat (limited to 'www/posts/markdown/atom.xml')
| -rw-r--r-- | www/posts/markdown/atom.xml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/www/posts/markdown/atom.xml b/www/posts/markdown/atom.xml index 36b8547..a00093d 100644 --- a/www/posts/markdown/atom.xml +++ b/www/posts/markdown/atom.xml @@ -12,7 +12,7 @@ <author><name>David T. Sadler.</name></author> <published>2020-03-30T12:00:00Z</published> <updated>2020-03-30T12:00:00Z</updated> - <content>![CDATA[<h1>Creating an Ebook With Markdown</h1><blockquote>Mon 30th March 2020 By David T. Sadler.</blockquote><p>Pandoc is a great tool for converting a file in one markup format into another. This means we can use it to convert a file written in Markdown into an EPUB file that is supported by many e-readers.</p><p>Lets start by writting a very simple markdown file called example_ebook.md.</p><pre><code class="markdown">--- + <content type="html"><h1>Creating an Ebook With Markdown</h1><blockquote>Mon 30th March 2020 By David T. Sadler.</blockquote><p>Pandoc is a great tool for converting a file in one markup format into another. This means we can use it to convert a file written in Markdown into an EPUB file that is supported by many e-readers.</p><p>Lets start by writting a very simple markdown file called example_ebook.md.</p><pre><code class="markdown">--- title: - type: main text: Example Ebook @@ -48,6 +48,6 @@ This is the second paragraph of chapter 2. This is the first paragraph of chapter 3. -This is the second paragraph of chapter 3.</code></pre><p>Note that the file begins with a YAML metadata block that starts and ends with three hyphens (---). This allows you to specify EPUB metadata such as the title and author.</p><p>Converting this to EPUB is done by running pandoc.</p><pre><code class="shell">$ pandoc example_ebook.md -t epub3 --toc -o example_ebook.epub</code></pre><p>There are several options that need to be passed to pandoc.</p><ul><li>example_ebook.md - This argument is the file that you are converting.</li><li>-t epub3 - Set the output format to be EPUB v3 book.</li><li>--toc - Include a table of contents in the output document. This will be derived from the H1 headers in the markdown.</li><li>-o example_ebook.epub - Tell pandoc to output the conversion to the named file instead of stdout.</li></ul><p>You can now copy the file example_ebook.epub to any device that supports the format or use one of the many software readers such as Calibre. However, if you wish to read this on a Kindle device you will need to convert it to the Mobi format.</p><p>Amazon provides a command line tool called KindleGen that can convert our EPUB file into the Mobi format. After downloading the tool just run it as shown below.</p><pre><code class="shell">$ kindlegen example_ebook.epub</code></pre><p>This will create a file called example_ebook.mobi that you can copy to your Kindle to read.</p><h3>Links</h3><a href="https://pandoc.org/">Pandoc.</a><a href="https://en.wikipedia.org/wiki/Markdown/">Markdown.</a><a href="https://en.wikipedia.org/wiki/EPUB/">EPUB.</a><a href="https://pandoc.org/MANUAL.html#extension-yaml_metadata_block">YAML metadata block.</a><a href="https://pandoc.org/MANUAL.html#epub-metadata">EPUB metadata.</a><a href="https://www.w3.org/community/epub3/">EPUB v3 book.</a><a href="https://calibre-ebook.com/">Calibre Application.</a><a href="https://en.wikipedia.org/wiki/Comparison_of_e-book_formats#Mobipocket">Mobi Format.</a><a href="https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211">KindleGen Application.</a><a href="/posts/markdown/">Markdown - Read More Posts.</a><p>I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a>]]</content> +This is the second paragraph of chapter 3.</code></pre><p>Note that the file begins with a YAML metadata block that starts and ends with three hyphens (---). This allows you to specify EPUB metadata such as the title and author.</p><p>Converting this to EPUB is done by running pandoc.</p><pre><code class="shell">$ pandoc example_ebook.md -t epub3 --toc -o example_ebook.epub</code></pre><p>There are several options that need to be passed to pandoc.</p><ul><li>example_ebook.md - This argument is the file that you are converting.</li><li>-t epub3 - Set the output format to be EPUB v3 book.</li><li>--toc - Include a table of contents in the output document. This will be derived from the H1 headers in the markdown.</li><li>-o example_ebook.epub - Tell pandoc to output the conversion to the named file instead of stdout.</li></ul><p>You can now copy the file example_ebook.epub to any device that supports the format or use one of the many software readers such as Calibre. However, if you wish to read this on a Kindle device you will need to convert it to the Mobi format.</p><p>Amazon provides a command line tool called KindleGen that can convert our EPUB file into the Mobi format. After downloading the tool just run it as shown below.</p><pre><code class="shell">$ kindlegen example_ebook.epub</code></pre><p>This will create a file called example_ebook.mobi that you can copy to your Kindle to read.</p><h3>Links</h3><a href="https://pandoc.org/">Pandoc.</a><a href="https://en.wikipedia.org/wiki/Markdown/">Markdown.</a><a href="https://en.wikipedia.org/wiki/EPUB/">EPUB.</a><a href="https://pandoc.org/MANUAL.html#extension-yaml_metadata_block">YAML metadata block.</a><a href="https://pandoc.org/MANUAL.html#epub-metadata">EPUB metadata.</a><a href="https://www.w3.org/community/epub3/">EPUB v3 book.</a><a href="https://calibre-ebook.com/">Calibre Application.</a><a href="https://en.wikipedia.org/wiki/Comparison_of_e-book_formats#Mobipocket">Mobi Format.</a><a href="https://www.amazon.com/gp/feature.html?ie=UTF8&amp;docId=1000765211">KindleGen Application.</a><a href="/posts/markdown/">Markdown - Read More Posts.</a><p>I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></content> </entry> </feed>
\ No newline at end of file |
