Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
logs/
.git
*.md
.cache
*Dockerfile*
.dockerignore
.dive-ci
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ site/
venv*/
.vscode/
docs/*/PDF/*.pdf
.python-version
.idea/
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# syntax=docker/dockerfile:1
ARG BASE_VERSION=3.2.4
ARG REGISTRY=docker.osdc.io/ncigdc
ARG SERVICE_NAME=gene-expression
ARG PYTHON_VERSION=python3.9

FROM ${REGISTRY}/${PYTHON_VERSION}-builder:${BASE_VERSION} as build
ARG SERVICE_NAME
ARG PIP_INDEX_URL
ENV PIP_INDEX_URL=$PIP_INDEX_URL

WORKDIR /build
# Install dependencies first so Docker can reuse the cached layer as
# long as we don't update any pins.
COPY epel.repo /etc/yum.repos.d/
RUN dnf install -y pandoc --enablerepo=epel && \
dnf install -y sed texlive texlive-xetex pango-devel

COPY requirements.txt .
RUN pip install -r requirements.txt

#RUN pip install git+https://github.com/jgrassler/mkdocs-pandoc
#COPY pandoc_converter.patch .
#COPY tables.patch .
#RUN patch -u /venv/lib/python3.9/site-packages/mkdocs_pandoc/pandoc_converter.py -i pandoc_converter.patch && \
# patch -u /venv/lib/python3.9/site-packages/mkdocs_pandoc/filters/tables.py -i tables.patch
COPY . /apps

WORKDIR /apps
RUN rm -rf docs/Data/Release_Notes/*.gz && \
bash build.sh

FROM ${REGISTRY}/nginx:${BASE_VERSION}
ARG NAME
ARG PYTHON_VERSION
ARG SERVICE_NAME
ARG GIT_BRANCH
ARG COMMIT
ARG BUILD_DATE

LABEL org.opencontainers.image.title="${SERVICE_NAME}" \
org.opencontainers.image.description="${SERVICE_NAME} container image" \
org.opencontainers.image.source="https://github.com/NCI-GDC/${SERVICE_NAME}" \
org.opencontainers.image.vendor="NCI GDC" \
org.opencontainers.image.ref.name="${SERVICE_NAME}:${GIT_BRANCH}" \
org.opencontainers.image.revision="${COMMIT}" \
org.opencontainers.image.created="${BUILD_DATE}"

COPY --chown=app:app nginx.conf /etc/nginx/conf.d/default.conf
COPY --chown=app:app --from=build /app /app
EXPOSE 80 443
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Generating PDFs from *_UG.yml files.
echo "$(date +'%d %B %Y - %k:%M'): ${ENVIRONMENT}: Looking for User Guides"
userGuides=()
for i in $( ls *_UG.yml ); do
userGuides+=(${i::${#i}-7})
done
echo "$(date +'%d %B %Y - %k:%M'): ${ENVIRONMENT}: Number of User Guides found: ${#userGuides[@]}"

for userGuide in "${userGuides[@]}"; do
echo "$(date +'%d %B %Y - %k:%M'): ${ENVIRONMENT}: ${userGuide}: Starting creation"
if [ ! -d "docs/Data_Portal/PDF/" ]; then
echo "$(date +'%d %B %Y - %k:%M'): ${ENVIRONMENT}: ${userGuide}: PDF Directory does not exists, creating ..."
mkdir docs/${userGuide}/PDF/
fi
echo "$(date +'%d %B %Y - %k:%M'): ${ENVIRONMENT}: ${userGuide}: Building PDF documents"
ENABLE_PDF_EXPORT=1 /venv/bin/mkdocs build -f ${userGuide}_UG.yml
done


echo "$(date +'%d %B %Y - %k:%M'): ${ENVIRONMENT}: Deploying new version to /app"
/venv/bin/mkdocs build -v --site-dir /app/
7 changes: 7 additions & 0 deletions epel9.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[epel9]
baseurl=https://nexus.osdc.io/repository/rpm-epel/9/Everything/x86_64
gpgcheck=0
metadata_expire=1d
mode=0640
name=Extra Packages for Enterprise Linux 9
enabled=0
19 changes: 19 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
server {
listen 80 default_server;
listen 443 ssl default_server;
listen [::]:80 default_server;
listen [::]:443 ssl default_server;

server_name _;

set $empty "";

ssl_ciphers aNULL;
ssl_certificate data:$empty;
ssl_certificate_key data:$empty;

location / {
root /app;
index index.html;
}
}
11 changes: 11 additions & 0 deletions pandoc_converter.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- /venv/lib/python3.9/site-packages/mkdocs_pandoc/pandoc_converter.py 2025-04-10 13:54:36.348159540 +0000
+++ /venv/lib/python3.9/site-packages/mkdocs_pandoc/pandoc_converter.py 2025-04-10 13:55:01.268162893 +0000
@@ -34,7 +34,7 @@
raise FatalError("Couldn't open %s for reading: %s" % (self.config_file,
e.strerror), 1)

- self.config = yaml.load(cfg)
+ self.config = yaml.full_load(cfg)

if not 'docs_dir' in self.config:
self.config['docs_dir'] = 'docs'
10 changes: 9 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ mkdocs-material>=9.5.26
pyyaml>=6.0.1
mkdocs-with-pdf>=0.9.3
# an init method changed it's signature. version 44 works. newer versions may too. untested.
weasyprint==44
weasyprint==44
# mkdocs~=0.17.5
# mkdocs-bootstrap~=0.1.1
# mkdocs-bootswatch~=0.4
# BSCodeTabs
# Markdown~=2.6.11
# MarkupSafe~=1.0
# mkdocs-pandoc
# mkdocs-pandoc-plugin
20 changes: 20 additions & 0 deletions tables.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- /venv/lib/python3.9/site-packages/mkdocs_pandoc/filters/tables.py 2025-04-10 09:11:33
+++ /venv/lib/python3.9/site-packages/mkdocs_pandoc/filters/tables.py 2025-04-10 11:18:15
@@ -88,7 +88,7 @@

# Initialize width arrays

- for i in range(0, len(self._split_row(lines_orig[0], has_border))):
+ for i in range(0, len(self._split_row(lines_orig[0]))):
widest_cell.append(0)
widest_word.append(0)
widths.append(0)
@@ -96,7 +96,7 @@
# Parse lines into array of cells and record width of widest cell/word

for line in lines_orig:
- row = self._split_row(line, has_border)
+ row = self._split_row(line)
# pad widest_cell to account for under length first row
for i in range(0, len(row) - len(widest_cell)):
widest_cell.append(0)
2 changes: 1 addition & 1 deletion theme/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
{% if page.canonical_url %}<link rel="canonical" href="{{ page.canonical_url }}">{% endif %}
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="/img/favicon.ico">{% endif %}

Expand Down
40 changes: 20 additions & 20 deletions theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{% if current_page.title == config.extra.gdcmvs_viewer_page_id %}
{% if page.title == config.extra.gdcmvs_viewer_page_id %}
<meta name="viewport" content="width=1024">
{% else %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% endif %}
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
{% if page.canonical_url %}<link rel="canonical" href="{{ page.canonical_url }}">{% endif %}
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="/img/favicon.ico">{% endif %}

<link rel="apple-touch-icon" href="/img/apple-touch-icon.png">

<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site_name }}</title>

<script src="https://assets.adobedtm.com/6a4249cd0a2c/073fd0859f8f/launch-39d47c17b228.min.js"></script>

Expand All @@ -43,14 +43,14 @@
{% endif %}
{% endfor %}

{% if current_page.title == config.extra.gdcmvs_viewer_page_id %}
{% if page.title == config.extra.gdcmvs_viewer_page_id %}
<!-- GDCMVS CSS-->
<link rel="stylesheet" type="text/css" href="{{ config.extra.gdcmvs_app_root }}/lib/css/jquery-ui.min.css" />
<link rel="stylesheet" type="text/css" href="{{ config.extra.gdcmvs_app_root }}/lib/css/pagination.min.css" />
<link rel="stylesheet" type="text/css" href="{{ config.extra.gdcmvs_app_root }}/dist/styles.css" />
{% endif %}

{% if current_page.title == "Home" %}
{% if page.title == "Home" %}
<link href="/css/homepage.css" rel="stylesheet">
{% endif %}

Expand All @@ -72,7 +72,7 @@
</script>
{% endif %}

{% if current_page.title == config.extra.dictionary_viewer_page_id %}
{% if page.title == config.extra.dictionary_viewer_page_id %}
{% include "apps/dictionary/html-shards/dictionary-deps.html" %}
<script src="/js/dictionary-init.js"></script>
{% endif %}
Expand All @@ -86,7 +86,7 @@
<!-- div id="sliding-drawer-container" class="sliding-drawer-container">
</div -->
<div class="parent-container">
{% if current_page.title != config.extra.dictionary_viewer_page_id and current_page.title != config.extra.gdcmvs_viewer_page_id %}
{% if page.title != config.extra.dictionary_viewer_page_id and page.title != config.extra.gdcmvs_viewer_page_id %}
<div class="spinParticle">
<div class="particle red"></div>
<div class="particle grey other-particle"></div>
Expand All @@ -96,44 +96,44 @@
{% include "nav.html" %}

<div id="docs-container" class="container">
<div data-current-page="{{current_page.title}}" id="body">
<div data-current-page="{{page.title}}" id="body">

{% if current_page.title == "Home" %}
{% if page.title == "Home" %}
{% include "homepage.html" %}
{% else %}
<!-- {% if toc and ((toc | first) is defined) and current_page.title != config.extra.dictionary_viewer_page_id %}
<div class="col-md-3 toc-container" role="navigation" aria-label="In-Page Navigation">{% include "toc.html" %}</div>
{% endif %} -->

{% if "/Encyclopedia" in current_page.abs_url %}
{% if "/Encyclopedia" in page.abs_url %}
{% include "encyclopedia/menu.html" %}
{% elif current_page.title != config.extra.dictionary_viewer_page_id and current_page.title != 'Home' and current_page.title != config.extra.gdcmvs_viewer_page_id %}
{% elif page.title != config.extra.dictionary_viewer_page_id and page.title != 'Home' and page.title != config.extra.gdcmvs_viewer_page_id %}
{% include "nav-section-map.html" %}
{% elif current_page.title == 'Home' %}
{% if toc and ((toc | first) is defined) %}
{% elif page.title == 'Home' %}
{% if page.toc and ((page.toc | first) is defined) %}
<div class="col-md-3 toc-container" role="navigation" aria-label="In-Page Navigation">{% include "toc.html" %}</div>
{% endif %}
{% endif %}

{% if current_page.title == config.extra.dictionary_viewer_page_id or current_page.title == config.extra.gdcmvs_viewer_page_id %}
{% if page.title == config.extra.dictionary_viewer_page_id or page.title == config.extra.gdcmvs_viewer_page_id %}
<div class="col-md-12 main-container" role="main" id="main" tabindex="-1">
{% else %}
<div class="col-md-9 main-container fadeInBlurIntroOld loading-content-old" role="main" id="main" tabindex="-1">
{% endif %}
{% if current_page.title == config.extra.encyclopedia_page_title%}
{% if page.title == config.extra.encyclopedia_page_title%}
{% include "encyclopedia/index.html" %}
{% else %}
{% include "content.html" %}
{% endif %}
</div>
{% if next_page or previous_page %}
<div class="history-nav-control-container clearfix" role="navigation" aria-label="footer navigation">
{% if next_page.ancestors and next_page.ancestors[0].active and current_page.title != config.extra.dictionary_viewer_page_id and current_page.title != config.extra.gdcmvs_viewer_page_id %}
{% if next_page.ancestors and next_page.ancestors[0].active and page.title != config.extra.dictionary_viewer_page_id and page.title != config.extra.gdcmvs_viewer_page_id %}
<a href="{{ next_page.url }}" class="btn pull-right indicate-right" title="Click to go to the Next Page: {{ next_page.title }}">
<span class="btn-nav-text">Next:</span> {{next_page.title}} <span class="fa fa-chevron-right"></span>
</a>
{% endif %}
{% if previous_page.ancestors and previous_page.ancestors[0].active and current_page.title != config.extra.dictionary_viewer_page_id and current_page.title != config.extra.gdcmvs_viewer_page_id %}
{% if previous_page.ancestors and previous_page.ancestors[0].active and page.title != config.extra.dictionary_viewer_page_id and page.title != config.extra.gdcmvs_viewer_page_id %}
<a href="{{ previous_page.url }}" class="btn pull-left indicate-left" title="Click to go to the Previous Page: {{ previous_page.title }}">
<span class="fa fa-chevron-left"></span> <span class="btn-nav-text">Previous:</span> {{previous_page.title}}</a>
{% endif %}
Expand Down Expand Up @@ -191,17 +191,17 @@
<script src="{{ path }}"></script>
{%- endfor %}

{% if current_page.title == config.extra.encyclopedia_page_title %}
{% if page.title == config.extra.encyclopedia_page_title %}
<script src="/js/encyclopedia.js"></script>
{% endif %}
{% if current_page.title == config.extra.gdcmvs_viewer_page_id %}
{% if page.title == config.extra.gdcmvs_viewer_page_id %}
<!-- GDCMVS JS-->
<script type="text/javascript" src="{{ config.extra.gdcmvs_app_root }}/lib/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="{{ config.extra.gdcmvs_app_root }}/lib/js/pagination.min.js"></script>
<script type="text/javascript" src="{{ config.extra.gdcmvs_app_root }}/lib/js/jsrender.min.js"></script>
<script type="text/javascript" src="{{ config.extra.gdcmvs_app_root }}/dist/bundle.js"></script>
{% endif %}
{% if current_page.title == "Home" %}
{% if page.title == "Home" %}
<script src="/js/homepage.js"></script>
{% endif %}
</div>
Expand Down
6 changes: 3 additions & 3 deletions theme/content.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% if meta.source %}
{% if page.meta.source %}
<div class="source-links">
{% for filename in meta.source %}
{% for filename in page.meta.source %}
<span class="label label-primary">{{ filename }}</span>
{% endfor %}
</div>
{% endif %}

{{ content }}
{{ page.content }}
2 changes: 1 addition & 1 deletion theme/nav-section-map-toc.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul class="nav bs-sidenav">
{% for toc_nav_item in toc %}
{% for toc_nav_item in page.toc %}
{% for toc_item in toc_nav_item.children %}
<li class="{% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a>
{% if toc_item.children %}
Expand Down
2 changes: 1 addition & 1 deletion theme/nav-section-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<a href="{{ sub_nav_item.url }}">
{{ sub_nav_item.title }}
</a>
{% if toc and ((toc | first) is defined) and sub_nav_item.active %}
{% if page.toc and ((page.toc | first) is defined) and sub_nav_item.active %}
{% include "nav-section-map-toc.html" %}
{% endif %}
</li>
Expand Down
8 changes: 4 additions & 4 deletions theme/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@

{% if false %}
<ul class="nav navbar-nav navbar-right">
<li {% if not previous_page %}class="disabled"{% endif %}>
<a rel="next" {% if previous_page %}href="{{ previous_page.url }}"{% endif %}>
<li {% if not page.previous_page %}class="disabled"{% endif %}>
<a rel="next" {% if page.previous_page %}href="{{ previous_page.url }}"{% endif %}>
<i class="fa fa-arrow-left"></i> Previous
</a>
</li>
<li {% if not next_page %}class="disabled"{% endif %}>
<a rel="prev" {% if next_page %}href="{{ next_page.url }}"{% endif %}>
<li {% if not page.next_page %}class="disabled"{% endif %}>
<a rel="prev" {% if page.next_page %}href="{{ next_page.url }}"{% endif %}>
Next <i class="fa fa-arrow-right"></i>
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion theme/toc.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="bs-sidebar hidden-print affix well animated fadeIn">
<ul class="nav bs-sidenav">
{% for nav_item in toc %}
{% for nav_item in page.toc %}
<li class="main {% if nav_item.active %}active{% endif %}"><a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
<ul class="nav">
{% for toc_item in nav_item.children %}
Expand Down