toc

python table of contents generator

https://github.com/youngrok/toc

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (3.7%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

python table of contents generator

Basic Info
  • Host: GitHub
  • Owner: youngrok
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Size: 14.6 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created almost 13 years ago · Last pushed about 2 years ago
Metadata Files
Readme License

README.md

toc

toc is HTML table of contents generator. It parses html, generate table of contents, and put anchors into original html.

usage

toc_html, body = table_of_contents(html)
toc_html, body = table_of_contents(html, url='http://somedomain.com/somepath')
toc_html, body = table_of_contents(html, anchor_type='following-marker')
  • anchor_type
    • following-marker : Add anchor tag to the end of heading tags. Anchor text is #
    • stacked-number : Add anchor tag to the begining of heading tags. Anchor text is like 1.2.3.
  • toc_html: table of contents
  • body: modified html

install

pip install toc

notes

  • toc use html5lib for html parser. It's much slower than the popular xml library for python, lxml, but parses more precisely, especially for html5.
  • I don't think ElementTree is more pythonic than DOM. So I used minidom for treebuilder and py-dom-xpath for xpath.

Owner

  • Name: Pak Youngrok
  • Login: youngrok
  • Kind: user
  • Location: Seoul, Korea
  • Company: ecolemo

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 14
  • Total Committers: 1
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Pak Youngrok p****k@g****m 14

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 3
  • Total pull requests: 0
  • Average time to close issues: over 1 year
  • Average time to close pull requests: N/A
  • Total issue authors: 3
  • Total pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • demosjarco (1)
  • yishaistreamline (1)
  • Tritaya (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 650 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 5
  • Total versions: 14
  • Total maintainers: 1
pypi.org: toc

Table of contents generator for html

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 5
  • Downloads: 650 Last month
Rankings
Dependent repos count: 6.7%
Dependent packages count: 10.0%
Downloads: 13.1%
Average: 14.4%
Forks count: 19.1%
Stargazers count: 23.1%
Maintainers (1)
Last synced: 11 months ago

Dependencies

pyproject.toml pypi
  • html5lib *