{"id":42212884,"url":"https://github.com/foliant-docs/foliantcontrib.anchors","last_synced_at":"2026-01-27T01:06:52.102Z","repository":{"id":57431792,"uuid":"176954816","full_name":"foliant-docs/foliantcontrib.anchors","owner":"foliant-docs","description":"Arbitrary anchors for Foliant","archived":false,"fork":false,"pushed_at":"2021-07-20T09:53:13.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-02T14:14:35.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foliant-docs.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-21T13:53:37.000Z","updated_at":"2021-07-20T09:52:48.000Z","dependencies_parsed_at":"2022-09-02T12:40:23.007Z","dependency_job_id":null,"html_url":"https://github.com/foliant-docs/foliantcontrib.anchors","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/foliant-docs/foliantcontrib.anchors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.anchors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.anchors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.anchors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.anchors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foliant-docs","download_url":"https://codeload.github.com/foliant-docs/foliantcontrib.anchors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.anchors/sbom","scorecard":{"id":406055,"data":{"date":"2025-08-11","repo":{"name":"github.com/foliant-docs/foliantcontrib.anchors","commit":"ce4e795a58c82e6ba79b8e64a718f63bc9600056"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T21:17:29.180Z","repository_id":57431792,"created_at":"2025-08-18T21:17:29.180Z","updated_at":"2025-08-18T21:17:29.180Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28794640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-27T01:06:51.579Z","updated_at":"2026-01-27T01:06:52.087Z","avatar_url":"https://github.com/foliant-docs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/pypi/v/foliantcontrib.anchors.svg)](https://pypi.org/project/foliantcontrib.anchors/)  [![](https://img.shields.io/github/v/tag/foliant-docs/foliantcontrib.anchors.svg?label=GitHub)](https://github.com/foliant-docs/foliantcontrib.anchors)\n\n# Anchors\n\nPreprocessor which allows to use arbitrary anchors in Foliant documents.\n\n## Installation\n\n```bash\n$ pip install foliantcontrib.anchors\n```\n\n## Config\n\nTo enable the preprocessor, add anchors to preprocessors section in the project config:\n\n```yaml\npreprocessors:\n    - anchors\n```\n\nThe preprocessor has some options, but most probably you won't need any of them:\n\n```yaml\npreprocessors:\n    - anchors:\n        element: '\u003cspan id=\"{anchor}\"\u003e\u003c/span\u003e'\n        tex: False\n        anchors: True\n        custom_ids: False\n```\n\n`element`\n:   Template of an HTML-element which will be placed instead of the `\u003canchor\u003e` tag. In this template `{anchor}` will be replaced with the tag contents. Ignored when tex is `True`. Default: `'\u003cspan id=\"{anchor}\"\u003e\u003c/span\u003e'`\n\n`tex`\n:   If this option is `True`, preprocessor will try to use TeX-language anchors: `\\hypertarget{anchor}{}`. Default: `False`\n\n\u003e Notice, this option will work only with `pdf` target. For all other targets it is set to `False`.\n\n`anchors`\n:   If this options is `True`, anchors tag will be processed. Turn off if you only want to process custom IDs. Default: `True`\n\n`custom_ids`\n:   Since version 1.0.5 preprocessor Anchors can also process Pandoc-style custom IDs. Set this option to `True` to do that. Default: `False`.\n\n## Usage\n\n**anchors**\n\nJust add an `anchor` tag to some place and then use an ordinary Markdown-link to this anchor:\n\n```html\n...\n\n\u003canchor\u003elimitation\u003c/anchor\u003e\nSome important notice about system limitation.\n\n...\n\nDon't forget about [limitation](#limitation)!\n\n```\n\nYou can also place anchors in the middle of paragraph:\n\n```html\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit.\u003canchor\u003emiddle\u003c/anchor\u003e Molestiae illum iusto, sequi magnam consequatur porro iste facere at fugiat est corrupti dolorum quidem sapiente pariatur rem, alias unde! Iste, aliquam.\n\n[Go to the middle of the paragraph](#middle)\n\n```\n\nYou can place anchors inside tables:\n\n```html\n\nName | Age | Weight\n---- | --- | ------\nMax  | 17  | 60\nJane | 98  | 12\nJohn | 10  | 40\nKaty | 54  | 54\nMike \u003canchor\u003eMike\u003c/anchor\u003e| 22  | 299\nCinty| 25  | 42\n\n...\n\nSomething's wrong with Mike, [look](#Mike)!\n\n```\n\n**custom IDs**\n\nSince version 1.0.5 preprocessor Anchors can also process [Pandoc-style custom heading identifiers](https://pandoc.org/MANUAL.html#heading-identifiers) (previously you had to use [CustomIDs preprocessor](https://foliant-docs.github.io/docs/preprocessors/customids/) for that purpose). To use this function, turn on the `custom_ids` option in your foliant.yml:\n\n```yaml\npreprocessors:\n    anchors:\n        ...\n        custom_ids: True\n```\n\nThen add custom identifiers to your headings:\n\n```\n# My heading {#foo}\n\nLorem ipsum, dolor sit amet consectetur adipisicing elit. Omnis non vitae placeat sapiente reprehenderit officia.\n\n```\n\nAfter processing your text will be look like this:\n\n```\n\u003cspan id=\"custom_id\"\u003e\u003c/span\u003e\n\n# My heading\n\nLorem ipsum, dolor sit amet consectetur adipisicing elit. Omnis non vitae placeat sapiente reprehenderit officia.\n\n```\n\n## Additional info\n\n**1. Anchors are case sensitive**\n\n`Markdown` and `MarkDown` are two different anchors.\n\n**2. Anchors should be unique**\n\nYou can't use two anchors with the same name in one document.\n\nIf preprocessor notices repeating anchors in one md-file it will throw you a warning. If you are building a flat document (e.g. PDF or docx with Pandoc), you will receive the warning even if anchor repeats in different md-files.\n\n**3. Anchors may conflict with headers**\n\nHeaders are usually assigned anchors of their own. Be careful, your anchors may conflict with them.\n\nPreprocessor will try to detect if you are using anchor which is already taken by the header and warn you in console.\n\n**4. Some symbols are restricted**\n\nYou can't use these symbols in anchors:\n\n```\n[]\u003c\u003e\\\"\n```\n\nAlso you can't use space.\n\n**5. But a lot of other symbols are available**\n\nAll these are valid anchors:\n\n```\n\u003canchor\u003e!important!\u003c/anchor\u003e\n\u003canchor\u003e_anchor_\u003c/anchor\u003e\n\u003canchor\u003esection(1)\u003c/anchor\u003e\n\u003canchor\u003esection/1/\u003c/anchor\u003e\n\u003canchor\u003eanchor$1$\u003c/anchor\u003e\n\u003canchor\u003eabout:info\u003c/anchor\u003e\n\u003canchor\u003etest'1';\u003c/anchor\u003e\n\u003canchor\u003eякорь\u003c/anchor\u003e\n\u003canchor\u003e👀\u003c/anchor\u003e\n```\n\n\n## Notice for Mkdocs\n\nIn many Mkdocs themes the top menu lays over the text with absolute position. In this situation all anchors will be hidden by the menu.\n\nPossible solution is to change the `element` option for your anchors to have a vertical offset. Example config:\n\n```yaml\npreprocessors:\n    - anchors:\n        element: '\u003cspan style=\"display:block; margin:-3.1rem; padding:3.1rem;\" id=\"{anchor}\"\u003e\u003c/span\u003e'\n```\n\nOr, even better, you can assign your anchor a class in `element` and add these rules to your custom mkdocs styles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.anchors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.anchors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.anchors/lists"}