Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:02443124ed4ee0d8d724fefd38bf9b271361cc09
  • Code
  • Branches (3)
  • Releases (7)
    • Branches
    • Releases
    • HEAD
    • refs/heads/dev-mike
    • refs/heads/main
    • refs/tags/v2023.1
    • v2023.11
    • v2023.10
    • v2023.9
    • v2023.6
    • v2023.5
    • v2023.4
    • v2023.3
  • 1306abd
  • /
  • src
  • /
  • chemfeat
  • /
  • markdown.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge
swh:1:cnt:585d3e36905a11b6cd0b3f6b45a38c32e39b0a1f
directory badge
swh:1:dir:cf8e3b3fa7b21fcd604d92217349ec6bb56069ad
revision badge
swh:1:rev:800919da4d6c104401e877a14e4bd7778e750ab4
snapshot badge
swh:1:snp:02443124ed4ee0d8d724fefd38bf9b271361cc09

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 800919da4d6c104401e877a14e4bd7778e750ab4 authored by Jan-Michael Rye on 25 July 2023, 13:32:51 UTC
Initial commit
Tip revision: 800919d
markdown.py
#!/usr/bin/env python3
'''
Functions for generating Markdown files.
'''

_SPECIAL_CHARS = r'\`*_{}[]<>()+-.!|'
_TRANS_TABLE = str.maketrans({char: f'\\{char}' for char in _SPECIAL_CHARS})


def escape(text):
    '''
    Escape special symbols in Markdown text.
    '''
    return text.translate(_TRANS_TABLE)

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API