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
  • 490ee88
  • /
  • scripts
  • /
  • generate_doc_mds.sh
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
  • release
content badge
swh:1:cnt:3ab50e0c745a496d27a9a4fdaef93e3bc327ccd7
directory badge
swh:1:dir:4b12b95c6c9f886d92b89e756a1b4f20b740f75f
revision badge
swh:1:rev:eae39f063cec1c4f9d7f0e0943ce61d3c600f6a1
snapshot badge
swh:1:snp:02443124ed4ee0d8d724fefd38bf9b271361cc09
release badge
swh:1:rel:ae4df68bbfe3502217ad5e5b257b9b42fa213f78

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
  • release
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: eae39f063cec1c4f9d7f0e0943ce61d3c600f6a1 authored by Jan-Michael Rye on 22 September 2023, 07:00:12 UTC
Miscellaneous fixes
Tip revision: eae39f0
generate_doc_mds.sh
#!/usr/bin/env bash
set -euo pipefail

SELF=$(readlink -f "${BASH_SOURCE[0]}")
cd -- "${SELF%%/*/*}"

# ------------------- Create, activate and configure venv -------------------- #
if [[ ! -d ./venv ]]
then
  python3 -m venv venv
fi
source ./venv/bin/activate
pip install -U pip
pip install -U .

# -------------------------------- Functions --------------------------------- #
function append_cmd_help()
{
  local path=$1
  local subcmd=${2:-}
  local cmd
  if [[ -n $subcmd ]]
  then
    cmd=(chemfeat "$subcmd" --help)
    cat >> "$path" << MD

## ${subcmd^}
MD
  else
    cmd=(chemfeat --help)
  fi
  cat >> "$path" << MD

~~~
\$ ${cmd[*]}
$("${cmd[@]}" 2>&1)
~~~
MD
}

function gen_cmd_help()
{
  local path=$1
  cat > "$path" << MD
# Command-Line Usage

The package provides the \`chemfeat\` executable which recognizes several subcommands:
MD
  append_cmd_help "$path"
  for subcmd in calculate configure describe
  do
    append_cmd_help "$path" "$subcmd"
  done
}

function gen_conf()
{
  path=$1
  cat > "$path" << 'CONF'
# Feature-set Configuration File

~~~yaml
CONF
  chemfeat conf >> "$path"
  echo '~~~' >> "$path"
}

# --------------------------------- Generate --------------------------------- #
gen_cmd_help ./doc/source/gen_command_help.md
chemfeat desc -o ./doc/source/gen_features.md
gen_conf ./doc/source/gen_feature_set_configuration.md

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