convert mkdocs´ html output to mallard/yelp xml
Project description
html2mallard / mkdocs-mallard
Extremely crude HTML to mallard help conversion. Specifically for output from mkdocs 1.x with RTD theme. It's a very basic regex extraction (→I'm looking forward to your letters!) and filtering process. It only retains some structural elements (headlines, paragraphs, tables, lists, notes). Doesn't even attempt to gather any topic relation/structure from the navigation list.
- Really only suitable for one-time/initial conversion.
- Requires some editing to get pages to validate. (Though they probably "work" in yelp as is).
- Links and image references certainly require manual cleanup. Nested lists or tables are likely to cause issues.
- And API docs are least convertible (only tested mkdocstrings, source dump is omitted, and there's obviously no syntax colorization in yelp; alternatively try mkgendocs).
- Primarily designed for mkdocs´ HTML output. But also contains some cleanup rules for fossil wiki pages (with github skin).
html2mallard
Simple command line tool to convert a single .html file:
html2mallard site/index.html > help/index.page
mkdocs-mallard
Converts a list of mkdocs output files to *.page files.
mkdocs-mallard
Requires an extra mallard_dir
in the mkdocs.yml
config:
site_name: logfmt1
docs_dir: docs
site_dir: html
mallard_dir: mallard
use_directory_urls: false
nav:
- Intro: index.md
theme:
name: readthedocs
highlightjs: false
repo_url: https://...
markdown_extensions:
- admonition
- codehilite
- attr_list
- def_list
- tables
- markdown.extensions.codehilite:
guess_lang: true
plugins:
- mkdocstrings
Also depends on use_directory_urls: false
, since the script only glob()
s
one level of *.html
files.
Adaption
The first two rewrite
rules likely require changes for other HTML sources
or templates. Specifically "^.+?</nav>"
should strip the initial
boilerplate, else might need expansion.
from project
import meta
meta | info |
---|---|
depends | - |
compat | Python ≥3.6 |
compliancy | !pep8, ~mallard, !doap |
system usage | - |
paths | - |
testing | - |
docs | - |
activity | abandoned |
state | alpha |
support | - |
contrib | - |
announce | - |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for html2mallard-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e434a8ca3cbc30b1fa799c8248db85b1ca66dfa9eea76cc5595117df8f1e2460 |
|
MD5 | c46247a77f2adca28460952be7f9e3cf |
|
BLAKE2b-256 | 7d018ae1577e66838b18e760596fd9f5fe09ae083841c2bb89de48600a5c9bfa |