app.converter
#
Submodules#
Package Contents#
Classes#
Convert Jekyll posts to Hugo posts |
|
Markdown converter that converts jekyll posts to hugo posts. |
- class app.converter.Converter(configurator: app.config.Configurator)#
Convert Jekyll posts to Hugo posts
- convert()#
Converts the Jekyll posts to Hugo posts
- class app.converter.WordpressMarkdownConverter(configurator: app.config.Configurator)#
Markdown converter that converts jekyll posts to hugo posts.
- fix_header(header: dict) dict #
Fix the Hugo header
Parameters#
- headerdict
The header to fix
Returns#
- dict
The fixed header
- fix_pre_content(post_lines: list[str]) list[str] #
Fixes the pre content from the post lines when enclosed in backticks code blocks.
- fix_html_tags(post_lines)#
Fixes the html tags from the post lines.
- _fix_html_tag(content: bs4.Tag, fixed_lines: list)#
Fixes the html tag.
- convert_post_content(post_content: str) str #
Converts the post content
Parameters#
- post_contentstr
The post content
Returns#
- str
The converted post content
- read_jekyll_post(reader: app.io.reader.IoReader)#
Read a Jekyll post from the reader.
Parameters#
- readerIoReader
The IoReader instance for reading.
- write_hugo_post(writer: app.io.writer.IoWriter, post_header: dict, post_content: str)#
Write a Hugo post to the specified writer.
Parameters#
- writerIoWriter
The IoWriter instance for writing.
- post_headerdict
The post header
- post_contentstr
The post content
- convert_jekyll_to_hugo(reader: app.io.reader.IoReader, writer: app.io.writer.IoWriter)#
Convert a Jekyll post to a Hugo post
Parameters#
- readerIoReader
The IoReader instance for reading.
- writerIoWriter
The IoWriter instance for writing.