Skip to content

Commit

Permalink
Merge pull request #231 from SamGuay/multiple-version-docs
Browse files Browse the repository at this point in the history
Automated version-control documentation for 2.1.9 and up
  • Loading branch information
arnaudbore authored Jul 13, 2023
2 parents 26840f3 + 25404cf commit 43023c7
Show file tree
Hide file tree
Showing 12 changed files with 229 additions and 199 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/publish_doc.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
name: Publish documentation

# Controls when the workflow will run

on:
release:
types: [published]
push:
branches:
- master
tags:
- '**'
# Allow this workflow manually from the Actions tab
workflow_dispatch:
pull_request:
branches:
- master
- 'releases/**'

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11"

- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
Expand All @@ -38,14 +42,22 @@ jobs:
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements-doc.txt
run: |
python3 -m pip install -r ./requirements-doc.txt
pip install -e .
- name: run portray
- name: Set git credentials
run: |
portray as_html
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Build API reference
run: pdocs as_markdown -o docs/dcm2bids dcm2bids

- name: Build docs for specific release
if: github.event_name == 'release'
run: mike deploy --push ${{ github.ref_name }} latest

- name: Deploy dev version
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
run: mike deploy --push dev
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# CHANGELOG

## **2.1.9 - 2022-06-17**

Some issues with pypi. Sorry for this.

### **What's Changed**

* Fix if dot in dcm files names by[ @arnaudbore](https://github.com/arnaudbore) in[ #169](https://github.com/UNFmontreal/Dcm2Bids/pull/169)
* Support output_dir override[ #170](https://github.com/UNFmontreal/Dcm2Bids/issues/170) by[ @GMerakis](https://github.com/GMerakis) in[ #171](https://github.com/UNFmontreal/Dcm2Bids/pull/171)
* BF - forgot bval bvec by[ @arnaudbore](https://github.com/arnaudbore) in[ #172](https://github.com/UNFmontreal/Dcm2Bids/pull/172)

### **New Contributors**

* [@GMerakis](https://github.com/GMerakis) made their first contribution in[ #171](https://github.com/UNFmontreal/Dcm2Bids/pull/171)

**Full Changelog**:[ 2.1.7...2.1.9](https://github.com/UNFmontreal/Dcm2Bids/compare/2.1.7...2.1.9)

## **2.1.8 - 2022-06-17**

This will be our last PR before moving to a new API.

### **What's Changed**

* Fix if dot in dcm files names by[ @arnaudbore](https://github.com/arnaudbore) in[ #169](https://github.com/UNFmontreal/Dcm2Bids/pull/169)
* Support output_dir override[ #170](https://github.com/UNFmontreal/Dcm2Bids/issues/170) by[ @GMerakis](https://github.com/GMerakis) in[ #171](https://github.com/UNFmontreal/Dcm2Bids/pull/171)
* BF - forgot bval bvec by[ @arnaudbore](https://github.com/arnaudbore) in[ #172](https://github.com/UNFmontreal/Dcm2Bids/pull/172)

### **New Contributors**

* [@GMerakis](https://github.com/GMerakis) made their first contribution in[ #171](https://github.com/UNFmontreal/Dcm2Bids/pull/171)

**Full Changelog**:[ 2.1.7...2.1.8](https://github.com/UNFmontreal/Dcm2Bids/compare/2.1.7...2.1.8)

## 2.1.7 - 2022-05-30

Last version before refactoring.
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "CHANGELOG.md"
1 change: 1 addition & 0 deletions docs/code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "CODE_OF_CONDUCT.md"
1 change: 1 addition & 0 deletions docs/how-to/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "CONTRIBUTING.md"
2 changes: 1 addition & 1 deletion docs/how-to/get-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ unfamiliar with GitHub and issues.

### 2. **Community support channels**

There is a couple of places you can look for
There are a couple of places you can look for

#### **[NeuroStars][neurostars]**

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "README.md"
2 changes: 1 addition & 1 deletion docs/tutorial/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ You have to input the filters yourself, which is way easier to define when you
have access to an example of the sidecar files.

You can generate all the sidecar files for an individual participant using the
[dcm2bids_helper](./use-main-commands.md#tools) command.
[dcm2bids_helper](/use-main-commands.md#tools) command.

### `dcm2bids_helper` command

Expand Down
10 changes: 10 additions & 0 deletions docs_helper/templates/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base.html" %}

{% block outdated %}
You're not viewing the latest stable version.
<a href="{{ '../' ~ base_url }}">


<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
128 changes: 128 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Project info
site_name: dcm2bids documentation
site_url: https://UNFmontreal.github.io/Dcm2Bids/
site_description: >-
This is the documentation for dcm2bids, a community-centered project that
aims to be an easy-to-use tool to automate the process of 1- converting
DICOM files to NIfTI files with dcm2niix and 2- reorganising NIfTI files
into the Brain Imaging Data Structure (BIDS).
# site_author:

# Repo info
repo_name: UNFmontreal/dcm2bids
repo_url: https://github.com/UNFmontreal/Dcm2Bids
edit_uri: blob/master/

# custom navbar order
nav:
- Home: index.md
- Get started:
- index: get-started/index.md
- Installation: get-started/install.md
- Tutorials:
- index: tutorial/index.md
- First steps: tutorial/first-steps.md
- How-to guides:
- index: how-to/index.md
- Get help and support: how-to/get-help.md
- Use main commands: how-to/use-main-commands.md
- Create a config file: how-to/create-config-file.md
- Use advanced commands: how-to/use-advanced-commands.md
- Contribute to dcm2bids: how-to/contributing.md
- Code of conduct: code_of_conduct.md
- Changelog: changelog.md
- API Reference: dcm2bids

markdown_extensions:
- admonition
- attr_list
- md_in_html
- pymdownx.caret
- pymdownx.emoji
- pymdownx.mark
- pymdownx.tilde
- pymdownx.critic
- pymdownx.keys
- pymdownx.details
- pymdownx.tabbed:
alternate_style: true
- pymdownx.snippets
# check_paths: true
- pymdownx.inlinehilite
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- footnotes



# Configuration
theme:
language: en
name: material
custom_dir: docs_helper/templates
features:
- announce.dismiss
- content.action.edit
- content.action.view
- content.code.annotate
- content.code.copy
- content.tooltips
- navigation.footer
- navigation.indexes
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- search.highlight
- search.suggest
- toc.follow
icon:
repo: fontawesome/brands/github
palette:
- media: "(prefers-color-scheme: light)"
primary: custom
scheme: default
toggle:
icon: material/brightness-6
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: custom
toggle:
icon: material/brightness-5
name: Switch to light mode

extra_css:
- assets/extra.css

# extra_javascript:
# - assets/..

# Customization
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/UNFmontreal/Dcm2Bids
name: dcm2bids on GitHub
- icon: fontawesome/brands/docker
link: https://hub.docker.com/r/unfmontreal/dcm2bids
name: dcm2bids on docker
version:
provider: mike
default: latest
alias_type: symlink
redirect_template: null
canonical_version: latest
version_selector: true
plugins:
- search
- git-revision-date-localized:
type: timeago
enable_creation_date: true
fallback_to_build_date: true
# - git-authors
125 changes: 0 additions & 125 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,125 +0,0 @@
[tool.portray]
modules = ["dcm2bids"]
docs_dir = "docs"
extra_dirs = ["docs_helper/assets"]
live_reload = true
# Set plugins
[[tool.portray.extra_markdown_extensions]]
[tool.portray.extra_markdown_extensions.toc]
permalink = "⚓︎"
separator = "-"

[[tool.portray.extra_markdown_extensions]]
[tool.portray.extra_markdown_extensions."pymdownx.highlight"]
linenums = true

[[tool.portray.extra_markdown_extensions]]
[tool.portray.extra_markdown_extensions."pymdownx.tasklist"]
custom_checkbox = true
clickable_checkbox = true

[tool.portray.mkdocs]
# Repository
repo_name = "UNFmontreal/dcm2bids" # Name in top right corner
# Set repo_url so anyone running from their own repo can see the dcm2bids repo.
repo_url = "https://github.com/UNFmontreal/Dcm2Bids"
edit_uri = "blob/master/" # Bring to the page on GH, but it won't open the _edit_ mode.

# Left navigation menu
# `index` is a special case for which the parent section will be clickable and
# link to the index.md without appending the url
nav = [{ Home = "README.md"},
{ "Get started" = [{index = "docs/get-started/index.md"},
{"Installation" = "docs/get-started/install.md"}]},
{ "Tutorials" = [{index = "docs/tutorial/index.md"},
{"First steps" = "docs/tutorial/first-steps.md"}]},
{ "How-to guides" = [{index = "docs/how-to/index.md"},
{"Get help and support" = "docs/how-to/get-help.md"},
{"Use main commands" = "docs/how-to/use-main-commands.md"},
{"Create a config file" = "docs/how-to/create-config-file.md"},
{"Use advanced commands" = "docs/how-to/use-advanced-commands.md"},
{"Contribute to dcm2bids" = "CONTRIBUTING.md"}]},
{"Code of conduct" = "CODE_OF_CONDUCT.md" },
{"Changelog" = "CHANGELOG.md"}
]

extra_css = ["docs/assets/extra.css"] # To fix some colors in light vs slate mode.

# Refer to https://squidfunk.github.io/mkdocs-material/reference/
# for the full list of extensions and config.
markdown_extensions = [ "admonition",
"attr_list",
"md_in_html",
"pymdownx.extra", # combines a bunch together
"pymdownx.caret",
"pymdownx.emoji",
"pymdownx.mark",
"pymdownx.tilde",
"pymdownx.critic",
"pymdownx.keys",
"pymdownx.details",
"pymdownx.tabbed",
"pymdownx.snippets",
"pymdownx.inlinehilite"]

[tool.portray.mkdocs.theme]
name = "material"
custom_dir = "docs_helper/templates" # dir to put overriding templates
features = [
# "navigation.tabs", # moves parent categories into horizontal menu under search bar
"navigation.indexes", # enables parents section to become and display index.md from their respective directories.
"navigation.top" # show the "back to top" button
]
# Blurb that is output when the doc site is shared on social media or elsewhere.
site_description = """
This is the documentation for dcm2bids, a community-centered project
that aims to be an easy-to-use tool to automate the process of 1- converting
DICOM files to NIfTI files with dcm2niix and 2- reorganising NIfTI files into the Brain
Imaging Data Structure (BIDS).
"""

icon = {repo = "fontawesome/brands/github"} # icon in top-right corner.
# TODO: Design a logo and/or favicon.
# favicon = "art/logo_small.png"
# logo = "art/logo_small.png"

# Light vs slate mode + switch
[[tool.portray.mkdocs.theme.palette]]
media = "(prefers-color-scheme: light)"
scheme = "default"

[tool.portray.mkdocs.theme.palette.toggle]
icon = "material/weather-night"
name = "Switch to dark mode"

[[tool.portray.mkdocs.theme.palette]]
media = "(prefers-color-scheme: dark)"
scheme = "slate"

[tool.portray.mkdocs.theme.palette.toggle]
icon = "material/weather-sunny"
name = "Switch to light mode"

## Footer icon in bottom-right corner
[[tool.portray.mkdocs.extra.social]]
icon = "fontawesome/brands/github"
link = "https://github.com/UNFmontreal/Dcm2Bids"
name = "dcm2bids on GitHub"

[[tool.portray.mkdocs.extra.social]]
icon = "fontawesome/brands/docker"
link = "https://hub.docker.com/r/unfmontreal/dcm2bids"
name = "dcm2bids on docker"


# Additional plugins
[[tool.portray.mkdocs.plugins]]
[tool.portray.mkdocs.plugins.search]

[[tool.portray.mkdocs.plugins]]
[tool.portray.mkdocs.plugins.git-revision-date-localized]
type = "timeago"
# enable_creation_date = true
fallback_to_build_date = true
# [[tool.portray.mkdocs.plugins]]
# [tool.portray.mkdocs.plugins.git-authors]
Loading

0 comments on commit 43023c7

Please sign in to comment.