Skip to main content

Easily utilize GitHub's automatically generated anchors within and across Markdown documents

Project description

AnchorHub

AnchorHub is a command-line tool that makes it easy and intuitive to utilize GitHub’s auto-generated anchor tags in your Markdown documents, allowing you to create rich, user-friendly documentation in your GitHub repos without having to figure out what those auto-generated tags will be.

Features

  • Easily use GitHub’s automatically generated anchor tags

  • Simple, customizable syntax that just works

  • Works with single files, a single directory level, or an entire directory tree

Installation

You can install AnchorHub using pip:

$ pip install anchorhub

If you’re having trouble with pip, you can also install from source:

$ git clone https://github.com/samjabrahams/anchorhub.git
$ cd anchorhub
$ python setup.py install

To-do List

  • Verify cross-platform compatibility (currently only tested on OSX)

  • Support for ReStructuredText

  • Define API for using custom anchor generation or

  • More tests!

Known Issues

  • Should not change text within in-line code blocks (those marked by ` backticks)


Quick Start Guide

1. Define your tags

Inside your Markdown files, define tags at the end of header lines. By default, the syntax for this is {#my-tag-here}:

# This is a header that I would like to make a tag for {#tag}

You can also use Setext (underlined) style headers {#setext}
------------------------------------------------------------

The default is similar to Pandoc’s Markdown header identifiers

2. Use the tags as you would regular HTML anchors

Elsewhere, you can use the previously defined tags inlinks to provide a direct path to the header:

[This links back to the header using the AnchorHub tag 'tag'](#tag)

[This one links to the Setext header](#setext)

3. Run AnchorHub on your Markdown files

anchorhub will parse your Markdown files. You’ve got a few options for running anchorhub: run it on a single file, run it on a single level of a directory, or run it on an entire directory tree.

Single file use:
$ anchorhub mytags.md

Directory use (single level):
$ anchorhub .

Directory use (provided directory level and all subdirectories):
$ anchorhub . -r

This will output your processed files in a new folder in your current directory, ‘anchorhub-out/’


License

Copyright 2016, Sam Abrahams. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anchorhub-0.14.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

anchorhub-0.14-py2.py3-none-any.whl (63.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file anchorhub-0.14.tar.gz.

File metadata

  • Download URL: anchorhub-0.14.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for anchorhub-0.14.tar.gz
Algorithm Hash digest
SHA256 19f9dcde9d28f4b90b5c5c9c539e130aa38ece02af8a783e8dfc85e437bca2d1
MD5 8ac028dfcd5b072e7f05dd3c79791272
BLAKE2b-256 067330f56b8009fbd87e28c93e45f903a0d2871db534108c0f8b5eb34824fbf6

See more details on using hashes here.

File details

Details for the file anchorhub-0.14-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for anchorhub-0.14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ee6932625855ed653b882fbf04bb0e06a8ee856d62dbdb86222de537cca0597c
MD5 6984d413376c6981642abaacdba7a87f
BLAKE2b-256 968c7f1981fd0980839459fe3ff323cdbf3cb614bb3ed468d723e0fb90c09f6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page