Skip to content

Commit

Permalink
Merge pull request #3 from cecoeco/main
Browse files Browse the repository at this point in the history
added docs
  • Loading branch information
cecoeco authored Aug 24, 2024
2 parents 1eabd9a + 32c83bb commit f3d9eac
Show file tree
Hide file tree
Showing 10 changed files with 416 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ URIs = "1"
julia = "1"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Documenter", "Test"]
3 changes: 0 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterMarkdown = "997ab1e6-3595-5248-9280-8efb232c3433"
HTTR = "4055d0b1-be8f-4929-99f5-a1ae5cc18666"

[compat]
HTTR = "0.0.1"
30 changes: 30 additions & 0 deletions docs/_overrides/partials/source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% import "partials/language.html" as lang with context %}
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
{% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</div>
<div class="md-source__repository">
{{ config.repo_name }}
</div>
</a>
{% if config.theme.twitter_url %}
<a href="{{ config.theme.twitter_url }}" title="Go to Twitter" class="md-source">
<div class="md-source__icon md-icon">
{% include ".icons/fontawesome/brands/twitter.svg" %}
</div>
<div class="md-source__repository">
{{ config.theme.twitter_name }}
</div>
</a>
{% endif %}
{% if config.theme.sponsor_url %}
<a href="{{ config.theme.sponsor_url }}" title="Go to Sponsor" class="md-source">
<div class="md-source__icon md-icon">
{% include ".icons/fontawesome/regular/heart.svg" %}
</div>
<div class="md-source__repository">
{{ config.theme.sponsor_name }}
</div>
</a>
{% endif %}
1 change: 1 addition & 0 deletions docs/examples/UserGuide/get_request_string_response.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

25 changes: 25 additions & 0 deletions docs/genfiles.jl
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
using Documenter, DocumenterMarkdown
using Literate

get_example_path(p) = joinpath(@__DIR__, ".", "examples", p)
OUTPUT = joinpath(@__DIR__, "src", "examples", "generated")

folders = readdir(joinpath(@__DIR__, ".", "examples"))

function getfiles()
srcsfiles = []
for f in folders
names = readdir(joinpath(@__DIR__, ".", "examples", f))
fpaths = "$(f)/" .* names
srcsfiles = vcat(srcsfiles, fpaths...)
end
return srcsfiles
end

srcsfiles = getfiles()

for (d, paths) in (("tutorial", srcsfiles),)
for p in paths
Literate.markdown(get_example_path(p), joinpath(OUTPUT, dirname(p));
documenter=true)
end
end
53 changes: 53 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
using Documenter, DocumenterMarkdown
using HTTR

include("genfiles.jl")

DocTestMeta = quote
using HTTR
end

DocMeta.setdocmeta!(HTTR, :DocTestSetup, DocTestMeta; recursive=true)

makedocs(
modules=[HTTR],
clean=true,
doctest=false,
#format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"),
sitename="HTTR.jl",
authors="Karandeep Singh et al.",
strict=[
:doctest,
:linkcheck,
:parse_error,
:example_block,
# Other available options are
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block,
# :footnote, :meta_block, :missing_docs, :setup_block
],
checkdocs=:all,
format=Markdown(),
draft=false,
build=joinpath(@__DIR__, "docs")
)

deploydocs(
devurl="latest",
repo="https://github.com/TidierOrg/HTTR.jl",
push_preview=true,
deps=Deps.pip(
"mkdocs",
"pygments",
"python-markdown-math",
"mkdocs-material",
"pymdown-extensions",
"mkdocstrings",
"mknotebooks",
"pytkdocs_tweaks",
"mkdocs_include_exclude_files",
"jinja2",
"mkdocs-video"
),
make=() -> run(`mkdocs build`),
target="site",
devbranch="main"
)
113 changes: 113 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1 +1,114 @@

theme:
name: material
logo: assets/logo.png
features:
- content.code.copy
# - announce.dismiss
- content.code.annotate
# - content.tabs.link
#- content.tooltips
# - header.autohide
# - navigation.expand
#- navigation.indexes
# - navigation.instant
# - navigation.prune
#- navigation.sections
#- navigation.tabs
# - navigation.tabs.sticky
- navigation.top
- navigation.footer
#- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
#- toc.integrate # Table of contents is integrated on the left; does not appear separately on the right.
- header.autohide # header disappears as you scroll
palette:

# Light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: crimson
accent: cyan
toggle:
icon: material/weather-sunny
name: Switch to dark mode

# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: crimson
accent: cyan
toggle:
icon: material/weather-night
name: Switch to light mode
font:
text: Lato
icon:
repo: fontawesome/brands/github # GitHub logo in top right
#logo: "material/gridoff" # Equinox logo in top left
# favicon: "_static/icon_transparent.svg"
custom_dir: "_overrides" # Overriding part of the HTML

# These additions are my own custom ones, having overridden a partial.
#twitter_name: ""
#twitter_url: ""
site_name: HTTR.jl
site_description: HTTR.jl
site_author: Lazaro Alonso and Karandeep Singh
site_url: ""

repo_url: https://github.com/TidierOrg/HTTR.jl
repo_name: HTTR.jl
edit_uri: "" # No edit button, as some of our pages are in /docs and some in /examples via symlink, so it's impossible for them all to be accurate

strict: true # Don't allow warnings during the build process
extra_javascript:
# The below three make MathJax work, see https://squidfunk.github.io/mkdocs-material/reference/mathjax/
- _static/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/kdpsingh
- icon: fontawesome/brands/twitter
link: https://twitter.com/kdpsinghlab

extra_css:
- stylesheets/custom.css
- assets/Documenter.css

markdown_extensions:
- tables
- admonition
- toc:
permalink: "¤" # Adds a clickable permalink to each section heading
toc_depth: 4
- pymdownx.arithmatex: # Render LaTeX via MathJax
generic: true
- pymdownx.details # Allowing hidden expandable regions denoted by ???
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences # Seems to enable syntax highlighting when used with the Material theme.
- pymdownx.tasklist:
custom_checkbox: true
- def_list
- pymdownx.tabbed:
alternate_style: true
- attr_list
- md_in_html
plugins:
- search # default search plugin; needs manually re-enabling when using any other plugins
- autorefs # Cross-links to headings
- include_exclude_files:
exclude:
- "_overrides"
# - mknotebooks # Jupyter notebooks
#- mkdocs-video
nav:
- "Home": "index.md"
16 changes: 16 additions & 0 deletions docs/src/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => {
MathJax.typesetPromise()
})
Loading

0 comments on commit f3d9eac

Please sign in to comment.