Saravanan666/pypi-org huggingface dataset:
Package: markdown-mermaid-to-images
markdown-mermaid-to-imagesA CLI tool for publishing markdown articles to dev.to. The tool will also update articles if they already exist
on dev.to. It matches articles based on title in the frontmatter.> Info: You will need to havepandoc preinstalled <https://pandoc.org/installing.html>_for this script to work correctly. Or you can use the Docker image instead.Usagepipinstallmarkdown-mermaid-to-imagesmarkdown_mermaid_to_images--helpUsage: markdown_mermaid_to_images [OPTIONS]Exports mermaid diagrams in Markdown documents as images.Options:-m,--filePATHPath to markdown file, where the mermaid
code blocks will be converted to images.-f,--folderPATHPath to folder where we will convert all
markdown mermaid code blocks to images.-i,--ignorePATHPath to folder to ignore, markdown files in
this folder will not be converted.-o,--outputPATHPath to folder where to save the new
markdown files.  [required]-l,--log-level[DEBUG|INFO|ERROR]
Log level for the script.--helpShow this message and exit.$markdown_mermaid_to_images-ftests/data-otests/data/output/-itests/data/another_folderDocker ImageYou can also use the Docker image that comes with all the dependencies preinstalled. In this example
you can find the output intests/data/outputon your host machine.$dockerrun-v${PWD}/tests/data/another_folder:/data/input-v${PWD}/tests/data/output:/data/outputtestExample Markdown FileWhere an example markdown file may look something like this. The meramid code blocks
must be surrounded by three ` and have the classmermaid.## Introduction

Example Document

## Heading

```mermaid
%% Image: image_name
graph LR;
  A --> B;
```

> INFO: Info

```mermaid
graph LR;
  A --> B
  B --> C
  subgraph 1;
  subgraph 2;
  C --> D;
  end
  end;
```This will then get converted into a file that looks likeIntroduction
------------

Example Document

Heading
-------

![Image](image_name.png)

> INFO: Info

![Image](7d2490309c1c4bf48069dd7399944ff4.png)GitLab CIYou can use also use this in your CI/CD with the provided Docker image. Below is an example.gitlab-ci.ymlfile,
you may wish to use or include. The advantage of this is you can publish your aritcles using CI/CD.stages:-pre-publishconvert-mermaid:markdown:image:registry.gitlab.com/hmajid2301/markdown-mermaid-to-imagesstage:pre-publishscript:-markdown_mermaid_to_images --folder tests/data --ignore tests/data/another_folder --output tests/data/outputSetup Development Environmentgitclonegit@gitlab.com:hmajid2301/markdown-mermaid-to-images.gitcdmarkdown-mermaid-to-imagespipinstalltoxmakeinstall-venvsource.venv/bin/activatemakeinstall-devChangelogYou can find thechangelog here.AppendixDocker Imageinspired by sc250024.
Package: markdown-notebook
Notebook style markdown extensionIf you work with Jupyter notebooks, you will remember they have the concept ofinputsandoutputsin the notation, an input is something you enter and and output what the compiler or interpreter returns (it is very useful with expression based languages like OCaml or Haskell).When working in a Jupyter to Notebook extension for Pelican I found problems trying to convert the inputs and outputs to a markdown syntax, so I think this could be useful to represent them in markdown.This extension adds support for the elements|[]>and|<[]to indicateoutputsandinputsrespectibly. They will be rendered insidecodeelements with defined class styles, for example:|[]> val a: int = 4 |[]>Would be rendered as:<codeclass="notebook_output">val a: int = 4</code>You can define a number between the brackets for the style:|[12]> val a: int = 5 |[]>Would be rendered as:<spanclass="notebook_output_index">12</span><codeclass="notebook_output">val a: int = 4</code>Configuration optionsoutput_classwhat class to use with the output code, by default isnotebook_outputshow_outputdisplay output, by default isTrue, set this if you want to hide the output at allshow_labeldisplay a label for the outputlabel_textused withshow_labelset the text for the label for each outputUsing the extensionFirst install with pip:pip install markdown-notebookand then set the extension name in your Python Markdown library, the name of the extension ismdx_notebook.
Package: markdownparser
MarkdownParserMarkdownParser 是一个 Markdown 语法解析器,用于实现 md 到 html 标签的转换安装pipinstallmarkdownparser快速使用importMarkdownParserhtml=MarkdownParser.parse('# Hello World!')print(html)#<div class='markdown-body'><h1>Hello World!</h1></div>接口函数# 解析 markdown 文本转 htmldefparse(text:str)->str:# 解析 md 文件转 htmldefparse_file(file_name:str)->str:# 解析 markdown 文本, 带目录树defparse_toc(text:str)->str:# 解析 md 文件, 带目录树defparse_file_toc(file_name:str)->str:接口类 Markdown, Block结果预览与 Markdown 功能测试本仓库下提供了了一个快速验证转换结果的工具 generate.pypythongenerate.py<FILE_NAME># python generate.py ./testfiles/md/test1.md# python generate.py README.md运行会生成index.html, 使用浏览器打开生成的index.html即可与您预期的渲染结果对比, README 的渲染结果如下所示实现思路Markdown解析器的代码实现您可通过取消core.py注释来获取树的结构defparse(self,text:str)->str:# 去除空行/注释/html标签lines=self.preprocess_parser(text)# print(lines)# 逐行解析,得到一颗未优化的树root=self.block_parser(lines)# root.info()# 优化,得到正确的markdown解析树tree=self.tree_parser(root)# tree.info()# 输出到屏幕 / 导出html文件returntree.toHTML()不支持四个空格变为代码段[^1]的引用方式Setext 形式的标题上标 / 下标 / 下划线<details><summary></summary></details>折叠块HTML 结果说明生成的结果会以 "markdown-body" 类名的一个div包裹例如<div class='markdown-body'>markdown内容</div>代码段会根据语言为 pre 加入一个类名便于后期高亮,例如class="language-cpp", 未定义语言则为language-UNKNOWN默认导出的HTML中层级任务列表会有显示问题,这是因为使用了ul+li+checkbox的方式,您需要添加以下css样式修正.markdown-body>ul>li:has(input){padding-left:0;margin-bottom:0;}.markdown-bodyul>li:has(input)>ul{list-style-type:none;padding-left:8px;}您可以使用parse_toc将 HashHeadBlock 提取出来组成目录树, 得到一个<div class="header-navigator">...</div>并添加到返回的 HTML 元素中, 您可能还需要一些 js 相关的代码实现跳转, 具体可以参考template.htmlletlinks=document.querySelectorAll('div a[href^="#"]');links.forEach(link=>{link.addEventListener('click',function(event){event.preventDefault();lettarget=document.querySelector(this.getAttribute('href'));target.scrollIntoView({behavior:'smooth'});});});以及一些样式美化.header-navigator{position:fixed;}如果您想添加对Mermaid的支持, 您可参考mermaid plugin在您的html页面<body>末尾添加如下<script><scripttype="module">constcodeBlocks=document.querySelectorAll('.language-mermaid');codeBlocks.forEach(codeBlock=>{codeBlock.classList.remove('language-mermaid');codeBlock.classList.add('mermaid');});importmermaidfrom'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';mermaid.initialize({startOnLoad:true});</script>请注意, 由于本Markdown解析器的CodeBlock解析得到的类名为language-mermaid, 而mermaid插件支持的类名格式为mermaid, 所以代码中手动修改了language-mermaid的类名如果您想添加对Latex数学公式的支持, 可以在html页面<body>末尾添加如下<script><script>MathJax={tex:{inlineMath:[['$','$'],['\\(','\\)']]}};</script><scriptid="MathJax-script"asyncsrc="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>注意,这里仅支持很少一部分数学公式参考Github Markdown CSSMermaid APIMathJaxcommonmark
Package: markdown-pdf
markdown-pdfThis is a small Python class that links two libraries:markdown-it-pyandPyMuPDF.
This class will create a PDF file from your set ofmarkdownfiles.Installationpipinstallmarkdown-pdfUsageCreate a pdf with TOC (bookmarks) from headings up to level 2.frommarkdown_pdfimportMarkdownPdfpdf=MarkdownPdf(toc_level=2)Add three sections of markdown to the pdf.
Each section starts on a new page.
Headings from the first section are not included in the TOC.
The second section header is centered using CSS.frommarkdown_pdfimportSectionpdf.add_section(Section("# Title\n",toc=False))pdf.add_section(Section("# Head1\n\nbody\n"),user_css="h1 {text-align:center;}")pdf.add_section(Section("## Head2\n\n### Head3\n\n"))Set the properties of the pdf document.pdf.meta["title"]="User Guide"pdf.meta["author"]="Vitaly Bogomolov"Save to file.pdf.save("guide.pdf")TheSectionclass defines a portion ofmarkdowndata,
which is processed according to the same rules.
The nextSectiondata starts on a new page.TheSectionclass can set the following attributes.toc: whether to include the headers<h1>-<h6>of this section in the TOC. Default is True.root: the name of the root directory from which the image file paths starts in markdown. Default ".".paper_size: name of paper size,as described here. Default "A4".borders: size of borders. Default (36, 36, -36, -36).
Package: markdownpy
MarkdownpySimple Python package to write Markdown document directly from a Python script.InstallLocallyClone the repository install it with pip:gitclonegit@github.com:aidanjungo/Markdownpy.gitcdMarkdownpy
pipinstall-e.From PyPiYou can install the last version ofMarkdownpywith pip:pipinstallmarkdownpyUsageYou can import and use the package in any Python script and use it to generate result or documentation files on the fly.frommarkdownpy.markdownpyimportMarkdownDocmd=MarkdownDoc("MySimpleMarkdown.md")md.h1("H1 title")md.h2("H2 title")md.p("paragraph")md.h2("Lists")mylist=[]foriinrange(5):mylist.append(f"item_{i}")md.blist(mylist)md.save()From more example, checkoutexample.pyBy the way, this README has been generated usingMarkdownpy, you can see the python script here:readme.py
Package: markdown-readme-generator
Welcome to Markdown Readme Generator 👋Gerador de readme.🏠Homepage✨DemoInstallpip3installmarkdown-readme-generatorUsagemrgenerator-cliRun testspython3run.pyAuthor👤Pedro MarinhoWebsite:https://pedroermarinho.github.io/Twitter:@pedroermarinhoGitHub:@pedroermarinhoLinkedIn:@pedroermarinho🤝 ContributingContributions, issues and feature requests are welcome!Feel free to checkissues page. You can also take a look at thecontributing guideShow your supportGive a ⭐️ if this project helped you!Creditsreadme-md-generator📝 LicenseCopyright © 2020Pedro Marinho.This project isMITlicensed.This README was created with themarkdown-readme-generator
Package: markdown-refdocs
Markdown RefdocsExtracts docstings and type annotations from a python package to generate reference documentation in markdown.
See an example of this at:https://creisle.github.io/markdown_refdocs/Getting StartedInstall the package from pippipinstallmarkdown_refdocsRun this from the command line or import the function to get the markdown returns as strings and
customize. This tool has the customary help manu you can view with the-hoption to see the
options documentationmarkdown_refdocs-hGenerate markdown reference documentation from your python package like somarkdown_refdocs/path/to/python/package-o/path/to/output/dirThis will generate markdown files under/path/to/output/dirwhich can
be used standalone or incorporated in aMkdocsbuildExamplesDocumentation for this package itself can be generated using this tool itselfmarkdown_refdocsmarkdown_refdocs-odocs/referenceThis will build the following files (1 file per python sub-module)docs/reference/
└── markdown_refdocs
    ├── links.md
    ├── main.md
    ├── markdown.md
    ├── parsers.md
    └── types.mdSee a live demo of this under:https://creisle.github.io/markdown_refdocsFeaturesparses google-style docstringsgenerates markdown output (this allows the user to link into the navigation or their main docs)can take package directories as inputreads type annotationspulls function signaturesLimitationscurrently only supportsgoogle-style docstrings. May add support for others later if requested.MotivationThe motivation for this package was that writing docs in
markdown is simpler to read and write than writing them in RST. There is an awesome package calledMkdocsfor turning your markdown documents into a static site. It has a
number of plugins which extract docstrings from python files, however none of them
are able to use the google docstring format which I prefer. If you're using a different docstring
format you can check them out here on theMkdocs plugin wiki.
Package: markdown-server
Markdown-server is a simple web application.
It converts markdown file to HTML and response bytext/html.How to useRuntime EnvironmentPython:3.7pip:19.1.1Library DependenciesSeerequirements.txt.Just tryStart serverYou don’t need any special preparation to try to start server. Just execute below commands.$ git clone https://github.com/ohbarye/markdown-server
$ cd markdown-server
$ virtualenv .venv
$ source .venv/bin/activate
(.venv)$ pip install -r requirements.txt
(.venv)$ markdownserver
    Bottle v0.12.8 server starting up (using WSGIRefServer())...
    Listening on http://localhost:8009/Or, you can install from PyPi.(.venv)$ pip install markdown-server
(.venv)$ markdownserver
    Bottle v0.12.8 server starting up (using WSGIRefServer())...
    Listening on http://localhost:8009/If server start up successfully, browse below URL and check the converted result.$ open http://localhost:8009/sample.mdOnly ConversionAdditionally, You can use the conversion function alone.(.venv)$ convert source_md_file target_html_fileDo as you likeMarkdown server purveyhttp://host/[file_name]URL. This corresponds toresources/markdown/[file_name].You can put any markdown file here.Converted file will be placed toresources/htmldirectory. Generated html file includes CSS so it’s ease to distribute.Environment variables likehost nameorport numberare set inenv.py. Edit arbitrarily.ms_port        = '8009'
ms_host        = 'localhost'The default markdown engine is Github flavored Markdown. If you want to use another style, add CSS and editenv.py.css_name       = 'github.css'
markdown_type  = 'gfm'
Package: markdown-site-utils
Markdown Site UtilsSome utilities for managing Markdown files with metadata.The notion is that a content-oriented website may be written as a
hierarchical series of Markdown files (with an ".md" extension) underneath
some data directory, e.g.:DATA_DIR/
  index.md
  foo.md
  bar.md
  subdir/
    index.md
    foo.md
    bar.mdEach file may contain metadata, written in TOML in a section at
the top, bounded by '+++' lines:+++
title = "My Page Title"
+++

# Some MarkdownYAML and JSON may also be used. YAML blocks should start and end with lines
consisting of three dashes; JSON blocks should consist of a single JSON object
with opening and closing braces on lines by themselves. The data block is optional
but if present must begin on the first line of the file.To use the library, you get create anmdsite.DBobject with the path to your
data directory:mydb = mdsite.DB("/path/to/data/dir")Then callget_data(path)for the path into the directory you want, leaving
out the.mdfilename suffix, and, if you are looking for an index file, leaving
outindex.md:data = mydb.get_data("/node/leaf")The above gets data for$DATA_DIR/node/leaf.md, or for$DATA_DIR/node/leaf/index.md, if that file exists instead.The library also supports hierarchical configuration, also written in TOML,
YAML, or JSON, stored in files calledconfig.{toml,yaml,json}depending on the
config language employed.
Package: markdown-slides
css: static/css/harvard.css
title: Markdown Slides Demo📽️ slidesCreate stunning presentations usingmarkdownpowered byreveal.js.This README is a slide deck. Runpip install markdown-slidesfrom the command line to install the package. Then runslides --demoto launch a presentation server and view the deck.Here is a simple figure floated to the right.Note:Speaker notes start withNote:on each slide and can be accessed by hitting theScode. They support$m\times a^{th}$.You can alsoinclude equationswrapped in backticks.\[\begin{aligned} F(x)&=\int dx\, \cos(x)\\ &=\sin(x) + C. \end{aligned}\]Create columns using adivwithclass="col". There must be an empty line after thedivfor embedded markdown to render.<div class="col-6">

Content. Use`col-4`or`col-6`to create 40% and
60% width columns,
respectively. Make sure the
numbers add up to 10 or
subsequent content may float.
</div>Code can be included withcode fences.defadd(a:int,b:int)->int:"""Add two integers."""returna+bReveal.js supports special syntax to set arbitrary HTML attributes onslides, such as this background gradient.<!-- .slide: data-background-gradient="radial-gradient(#E5CAC9, #B55A5A)" -->This also works forelements:green bullet point-green bullet point <!-- .element: style="color:#4db848" -->Want a full-screen image? Use thedata-background-imageattribute, as illustrated on the next slide with a penguin.unsplash.comhas a great collection of free images.<!-- .slide: data-background-image="[path-to-image-file]"-->For labeled slides, we can link back to them. E.g., thenext one.This is a slide labeled with the idnext-slide.<!-- .slide: id="next-slide" -->Also note the vertical slide below. 👇^^^Vertical slidescan be used to logically group content. They are created using the^^^separator between slides.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.--- CiceroSymbolDescription$n$Number of samples$x_{ij}$$j^\text{th}$covariate for the$i^\text{th}$sample$y_i$target for the$i^\text{th}$sampleimportantbulletsandnumbereditemsJekyll-style frontmattercan be used to configure the presentation. Seeslides/frontmatter.schema.yamlfor details.Visit thereveal.js websitefor further information.
Package: markdown-sub-sup
markdown_sub_supExtends thePython Markdown.
Adds the possibility to use^something^to create<sup>something</sup>or~something~to create<sub>something</sub>Install through pip:pipinstallmarkdown_sub_supTo enable the markdown_sub_sup package and use it in your markdown generation just add it like so:importmarkdownresult=markdown.markdown(textToRender,extensions=["markdown_sub_sup",])
Package: markdown-svgbob
markdown-svgbobThis is an extension forPython Markdownwhich renders diagrams usingsvgbob.You can try it out using theSvgbob Editoror theAsciiGrid Editor.Project/Repo:Code Quality/CI:NamerolesinceuntilManuel Barkhau (mbarkhau@gmail.com)author/maintainer2019-04-Install$pipinstallmarkdown-svgbobThis package includes the following binaries:svgbob_0.5.5_x86_64-Darwinsvgbob_0.5.5_x86_64-Linuxsvgbob_0.5.5_x86_64-Windows.exeIf you are on another platform, or want to use a more recent version ofsvgbob_cli, you will need to install rust and then svgbob via cargo.$curlhttps://sh.rustup.rs-sSf|sh# see https://rustup.rs/$cargoinstallsvgbob_cliThis extension will always use the installed version of svgbob if it is available.UsageIn your markdown text you can define the block:```bob
     .---.
    /-o-/--
 .-/ / /->
( *  \/
 '-.  \
    \ /
     '
```The info stringbobis chosen to matchspongedown.Development/Testing$gitclonehttps://github.com/mbarkhau/markdown-svgbob
$cdmarkdown-svgbob
$makeconda
$makelintmypytestMkDocs IntegrationIn yourmkdocs.ymladd this to markdown_extensions.markdown_extensions:-markdown_svgbob:tag_type:inline_svgbg_color:whitefg_color:blackmin_char_width:80Valid options fortag_typeareinline_svg(the default),img_utf8_svgandimg_base64_svg.The optionmin_char_widthallows you to create diagrams of a uniform scale.Changelog forhttps://github.com/mbarkhau/markdown-svgbobv202112.1022Upgrade svgbob binaries to 0.5.5v202109.1020Upgrade to svgbob 0.6.2 for LinuxPackaging with lib3to6==202108.1048I can't get newer binaries for windows or macos, contributions to
svgbob would be welcome.https://github.com/ivanceras/svgbob/issues/35v202107.1018Fix: False positive warning due to 'toc' extension.v202104.1016Fix: Close file descriptiors of PopenAdd support for blocks with extra backticksv202103.1015Fix related to#14: SinceMarkdown>=3.3support forMarkdown in HTMLwas broken.v202006.0015Fix:bg_colornot updated in some casesv202001.0013-betaFix #2: Ignore trailing whitespace after closing fence.v202001.0012-betaAdd:min_char_widthoption. Allows diagrams in a document to have a uniform scale.v202001.0011-betaFix: Bad image substitution when markdown has multiple diagramsv202001.0009-betaFix: Bad parsing of fencesv201907.0008-betaFix: use PEP 508 environment marker to not always install thetypingpackage. Fixes gitlab#1v201905.0007-betaAdd:bg_colorandfg_coloroptionsv201905.0006-betaFix: better error reportingFix: cleanup temp dirv201904.0004-betaInitial release
Package: markdown-table-generator
py-markdown-table-generatorPython library to generate Markdown table.UsageCLILibraryBuildTestContributeUsagepip3installmarkdown_table_generatorCLIcsv-to-md-s";"-actests/table.csv# |   OS    |      Creator      |  Company  |# |:-------:|:-----------------:|:---------:|# | Ubuntu  | Mark Shuttleworth | Canonical |# | FreeBSD |                   |           |# | Fedora  |                   |  Red Hat  |csv-to-md-s";"-artests/table.csv# |      OS |           Creator |   Company |# |--------:|------------------:|----------:|# |  Ubuntu | Mark Shuttleworth | Canonical |# | FreeBSD |                   |           |# |  Fedora |                   |   Red Hat |csv-to-md-s";"-artests/table.csv|xclip-selectionclipboard# Copy markdown table in clipboardpsql-h127.0.0.1-Upostgrespostgres-c"select * from test"--csv|csv-to-md# Generate markdown table from PostgreSQL queryLibraryfrommarkdown_table_generatorimportgenerate_markdown,table_from_string_list# ====================================================# Generate markdown table from list of list of strings# ====================================================rows=[["OS","Creator","Company"],["Ubuntu","Mark Shuttleworth","Canonical"],["FreeBSD",None,None],["Fedora",None,"Red Hat"],]table=table_from_string_list(rows,Alignment.CENTER)markdown=generate_markdown(table)print(markdown)# |   OS    |      Creator      |  Company  |# |:-------:|:-----------------:|:---------:|# | Ubuntu  | Mark Shuttleworth | Canonical |# | FreeBSD |                   |           |# | Fedora  |                   |  Red Hat  |# ====================================================# Generate markdown table from CSV# ====================================================csv="""OS;Creator;CompanyUbuntu;Mark Shuttleworth;CanonicalFreeBSD;;Fedora;;Red Hat"""table=table_from_csv(csv.splitlines(),";",Alignment.RIGHT)markdown=generate_markdown(table)print(markdown)# |      OS |           Creator |   Company |# |--------:|------------------:|----------:|# |  Ubuntu | Mark Shuttleworth | Canonical |# | FreeBSD |                   |           |# |  Fedora |                   |   Red Hat |Buildpython3-mvenvvenv
../venv/bin/activate
pipinstall-rrequirements.txt
python3-mbuildTestpython3-mvenvvenv
../venv/bin/activate
pipinstall-rrequirements.txt
pytestContributeln-s"$(pwd)/sh/pre-commit.sh".git/hooks/pre-commit... and let's code!
Package: markdown_tags
#Markdown Tags-----A small library for writing markdown with a tree structure of python objects that you can transform into amarkdown snippet(string).I started it by extracting some code I wrote for a reddit bot.It was partially inspired by looking at the ScalaTags examples(although not using it).ex. 2 Paragraphs, 1 in Italic the other in Bold.import markdown_tags as mtags = m.MD(m.Paragraph(m.Italic("Italian")), m.Paragraph(m.Bold("Boring, Portland")))markdown_str = tags.tags_to_markdown(recover=False, format_md=m.MarkdownFormats.reddit)*returns a markdown string that will render as:**Italian***Boring, Portland**'ex. of a nested list or a list with multi paragraph items.import markdown_tags as mtags = m.MD(m.UnorderedList.with_title("Maslow's hierarchy of needs partial outline",m.OrderedList(m.UnorderedList.with_title("Physiological needs","Air","Water"),m.UnorderedList.with_title("Safety needs","Personal security","Financial security","Health and well-being","Safety net against accidents/illness " +"and their adverse impacts"),"Love and belonging","Esteem","Self-actualization"),"Research","Criticism"))*returns a markdown string that will render as:*Maslow's hierarchy of needs partial outline+ Needs1. Physiological needs+ Air+ Water2. Safety needs+ Personal security+ Financial security+ Health and well-being+ Safety net against accidents/illness and their adverse impacts3. Love and belonging4. Esteem5. Self-actualization+ Research+ Criticism*note that the discount markdown implementation used by reddit seems to translate this to html fine but it shows upa little strange with outer unordered list w/ the same indentation as inner ordered list on reddit.*Tested with the discount markdown implementation used by reddit.I might look into testing with other markdown implementations later.