Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Larralde
peptides.py
Commits
bed751e6
Commit
bed751e6
authored
Oct 25, 2021
by
Martin Larralde
Browse files
Use `sphinx.ext.extlinks` to provide publication links via DOI and PMID
parent
a525c537
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
bed751e6
...
...
@@ -107,7 +107,8 @@ The original R `Peptides` package was written by [Daniel Osorio](https://orcid.o
[
Paola Rondón-Villarreal
](
https://orcid.org/0000-0001-8209-3885
)
and
[
Rodrigo Torres
](
https://orcid.org/0000-0003-1113-3020
)
, and is licensed under
the terms of the
[
GNU General Public License v2.0
](
https://choosealicense.com/licenses/gpl-2.0/
)
.
The
[
EMBOSS] applications are released under the [GNU General Public License v1.0
](
https://www.gnu.org/licenses/old-licenses/gpl-1.0.html
)
.
The
[
EMBOSS
](
http://emboss.bioinformatics.nl/cgi-bin/emboss/
)
applications are
released under the
[
GNU General Public License v1.0
](
https://www.gnu.org/licenses/old-licenses/gpl-1.0.html
)
.
*
This project is in no way not affiliated, sponsored, or otherwise endorsed
by the
[
original `Peptides` authors
](
https://github.com/dosorio
)
. It was developed
...
...
docs/conf.py
View file @
bed751e6
...
...
@@ -33,7 +33,37 @@ sys.modules['peptides.tables'] = types.ModuleType('peptides.tables')
# -- Sphinx Setup ------------------------------------------------------------
# import docutils.nodes
# import docutils.utils
# import sphinx.transforms
#
# def doi_role(role, rawtext, text, lineno, inliner, options=None, content=None):
# node = docutils.nodes.reference(
# rawtext,
# "doi:{}".format(docutils.utils.unescape(text)),
# refuri="https://doi.org/{}".format(text),
# )
# return [node], []
#
# def pmid_role(row, rawtext, text, lineno, inliner, options=None, content=None):
# try:
# pmid = int(text)
# except ValueError:
# msg = inliner.reporter.error("Invalid PMID: {!r}".format(text), line=lineno)
# prb = inliner.problematic(rawtext, rawtext, msg)
# return [prb], [msg]
# node = docutils.nodes.reference(
# rawtext,
# "PMID:{}".format(pmid),
# refuri="https://pubmed.ncbi.nlm.nih.gov/{}".format(pmid),
# )
# return [node], []
#
def
setup
(
app
):
# Add roles for DOI and PMID
# app.add_role("doi", doi_role)
# app.add_role("pmid", pmid_role)
# Add custom stylesheet
app
.
add_css_file
(
os
.
path
.
join
(
"_static/css/main.css"
))
# app.add_js_file("js/apitoc.js")
...
...
@@ -88,6 +118,7 @@ extensions = [
"sphinx.ext.coverage"
,
"sphinx.ext.mathjax"
,
"sphinx.ext.todo"
,
"sphinx.ext.extlinks"
,
"sphinx_bootstrap_theme"
,
"recommonmark"
,
]
...
...
@@ -173,6 +204,14 @@ htmlhelp_basename = peptides.__name__
# -- Extension configuration -------------------------------------------------
# -- Options for extlinks extension ------------------------------------------
extlinks
=
{
'doi'
:
(
'https://doi.org/%s'
,
'doi:%s'
),
'pmid'
:
(
'https://pubmed.ncbi.nlm.nih.gov/%s'
,
'PMID:%s'
),
}
# -- Options for imgmath extension -------------------------------------------
imgmath_image_format
=
"svg"
...
...
peptides/__init__.py
View file @
bed751e6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment