preprocess ¤
HTML pre-processing.
Functions:
-
autoclean
–Auto-clean the soup by removing elements.
-
preprocess
–Pre-process HTML with user-defined functions.
autoclean ¤
autoclean(soup: BeautifulSoup) -> None
Auto-clean the soup by removing elements.
Parameters:
-
soup
(BeautifulSoup
) –The soup to modify.
Source code in src/mkdocs_llmstxt/preprocess.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
preprocess ¤
preprocess(
soup: BeautifulSoup, module_path: str, output: str
) -> None
Pre-process HTML with user-defined functions.
Parameters:
-
soup
(BeautifulSoup
) –The HTML (soup) to process before conversion to Markdown.
-
module_path
(str
) –The path of a Python module containing a
preprocess
function. The function must accept one and only one argument calledsoup
. Thesoup
argument is an instance ofbs4.BeautifulSoup
. -
output
(str
) –The output path of the relevant Markdown file.
Returns:
-
None
–The processed HTML.
Source code in src/mkdocs_llmstxt/preprocess.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|