-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marc Lichtman
committed
Apr 15, 2024
1 parent
73bb471
commit 7b7858c
Showing
4 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build docs and deploy static content to Pages | ||
|
||
on: | ||
push: | ||
branches: ["json_schema"] # TODO CHANGE TO MAIN ONCE PIPELINE WORKS | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install prereqs | ||
run: apt install python3-pip pandoc inkscape -y | ||
- name: Pip installs | ||
run: pip install pylatex | ||
- name: Build docs | ||
run: python3 docs-generator.py | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: '.' # Upload entire repository, TODO ONLY UPLOAD THE HTML AND PDF | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ sigmf-spec.pdf | |
sigmf-spec.out | ||
sigmf-spec.log | ||
sigmf-spec.aux | ||
svg-inkscape/ | ||
svg-inkscape/ | ||
sigmf-spec.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
print("SigMF Version: " + sigmf_version) | ||
|
||
def add_code_tags(text): # swaps every pair of ` ` for \code{} | ||
text = text.replace('_', '\\_') # need to escape underscores when inside a command | ||
while text.find('`') != -1: | ||
text = text.replace('`', '\\code{', 1) | ||
text = text.replace('`', '}', 1) | ||
|
@@ -159,3 +160,7 @@ def gen_fields(doc, d): | |
doc.generate_pdf('sigmf-spec', clean_tex=False, compiler_args=['--shell-escape']) # clean_tex will remove the generated tex file | ||
except subprocess.CalledProcessError as e: | ||
print(e) # this seems normal to occur | ||
|
||
# Generate HTML | ||
css_url = "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
subprocess.run(f"pandoc sigmf-spec.tex -f latex -t html -s -o sigmf-spec.html --toc --toc-depth=3 -c {css_url}".split()) |