MediaWiki: Skirtumas tarp puslapio versijų

Iš OeeTechWiki.
Jump to navigation Jump to search
(Naujas puslapis: __TOC__ === https://dev.to/wizlee/sanitize-and-convert-html-to-markdown-for-importing-notes-into-joplin-4537 === === Step 2 [https://dev.to/wizlee/sanitize-and-convert-html-to-...)
 
(Šalinamas visas turinys iš puslapio)
Žyma: Panaikinta
1 eilutė: 1 eilutė:
__TOC__
 
  
=== https://dev.to/wizlee/sanitize-and-convert-html-to-markdown-for-importing-notes-into-joplin-4537 ===
 
 
=== Step 2 [https://dev.to/wizlee/sanitize-and-convert-html-to-markdown-for-importing-notes-into-joplin-4537#top ↑top] ===
 
 
To convert from the sanitize HTML into Markdown, [https://pandoc.org/ pandoc] is used. This is a command line tool, an external library is installed using pip to use pandoc easier in Python.
 
 
<pre>pip install pypandoc </pre>
 
After installing, the code snippet below shows how to call pypandoc to convert HTML into Markdown.
 
 
<syntaxhighlight lang="python">pypandoc.convert_file(html_path,
 
    'markdown+pipe_tables+backtick_code_blocks-markdown_attribute',
 
    format='html',
 
    outputfile=md_path)</syntaxhighlight>
 
This pandoc documentation shows [https://pandoc.org/MANUAL.html#options all the supported input and output formats]. If you are curious about the ‘plus’ and ‘minus’ strings after the format, those are for adding or removing pandoc extensions respectively. The Markdown files generated using these extensions provide the best imported Joplin notes. Check out [https://pandoc.org/MANUAL.html#extensions this section] to understand more details about the extensions.
 

01:35, 19 lapkričio 2021 versija