Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cadojo committed Apr 28, 2024
1 parent 41f1246 commit b265e53
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 244 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ Manifest.toml

# As should .vscode!
.vscode

# Python virtual environments
venv
9 changes: 1 addition & 8 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
build/
site/
.quarto
/.quarto/
venv
_book
_site
_manuscript
*.pdf
*.html
.quarto
2 changes: 0 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[deps]
AstrodynamicalModels = "4282b555-f590-4262-b575-3e516e1493a7"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Quarto = "d7167be5-f61b-4dc9-b75c-ab62374668c5"
QuartoDocumenter = "73f83fcb-c367-40db-89b6-8fd94701aaf2"
9 changes: 0 additions & 9 deletions docs/_extensions/quarto-ext/latex-environment/_extension.yml

This file was deleted.

150 changes: 0 additions & 150 deletions docs/_extensions/quarto-ext/latex-environment/latex-environment.lua

This file was deleted.

46 changes: 31 additions & 15 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
project:
type: book
type: website

book:
title: "Doc"
author: "Norah Jones"
date: "4/7/2024"
chapters:
- index.qmd
- intro.qmd
- summary.qmd
- references.qmd
website:
title: "QuartoDocumenter.jl"
bread-crumbs: false
navbar:
left:
- href: index.qmd
text: Home
sidebar:
search: true
contents:
- section: "Overview"
contents:
- index.qmd
- section: "Examples"
contents:
- examples/index.qmd
- section: "Reference"
contents:
- reference/index.qmd

bibliography: references.bib
execute:
cache: false
freeze: false
echo: true
output: true
warning: false

format:
html:
theme: cosmo
pdf:
documentclass: article
shift-heading-level-by: 1
theme:
light: lightly
dark: darkly
css: styles.css
toc: true



Binary file removed docs/cover.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/examples/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Examples
15 changes: 6 additions & 9 deletions docs/index.qmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Preface {.unnumbered}
---
title: "QuartoDocumenter.jl"
sidebar: true
---

This is a Quarto book.
This is a Quarto website.

To learn more about Quarto books visit <https://quarto.org/docs/books>.


```{julia}
using QuartoDocumenter, AstrodynamicalModels
QuartoDocumenter.autodoc(AstrodynamicalModels)
```
To learn more about Quarto websites visit <https://quarto.org/docs/websites>.
5 changes: 0 additions & 5 deletions docs/intro.qmd

This file was deleted.

1 change: 1 addition & 0 deletions docs/quarto/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Quarto
7 changes: 7 additions & 0 deletions docs/reference/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Reference

```{julia}
#| echo: false
using QuartoDocumenter, AstrodynamicalModels
QuartoDocumenter.autodoc(AstrodynamicalModels)
```
19 changes: 0 additions & 19 deletions docs/references.bib

This file was deleted.

4 changes: 0 additions & 4 deletions docs/references.qmd

This file was deleted.

1 change: 1 addition & 0 deletions docs/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* css styles */
3 changes: 0 additions & 3 deletions docs/summary.qmd

This file was deleted.

36 changes: 16 additions & 20 deletions src/QuartoDocumenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro autodoc(lvalues...)
end
end

macro autodocs(lvalues)
macro autodoc(lvalues)
return quote
autodoc(@__MODULE__, $(lvalues)...)
end
Expand All @@ -27,12 +27,6 @@ function process_headers(markdown)
for (index, item) in enumerate(markdown.content)
if item isa Markdown.Header
newlevel = min(level(item) + 3, 6)
if item.text isa AbstractVector
@info "Appending to item.text"
push!(item.text, " {.unnumbered} ")
elseif item.text isa AbstractString
item.text *= " {.unnumbered} "
end
markdown.content[index] = Markdown.Header{newlevel}(item.text)
elseif :content in propertynames(item)
markdown.content[index] = process_headers(item)
Expand Down Expand Up @@ -76,32 +70,34 @@ function process(markdown)
)
end

"""
Return the documentation string associated with the provided name, with
substitutions to allow for compatibility with [Quarto](https://quarto.org).
"""
function doc end

function doc(mod::Module, sym::Symbol)
parent = which(mod, sym)
docmkd = copy(Base.Docs.doc(Docs.Binding(parent, sym)))
return doc(docmkd)
end

function doc(any::Any)
@info Base.Docs.doc(any) |> typeof
docmkd = process(
copy(Base.Docs.doc(any))
)

return Markdown.MD(
Markdown.parse(""":::{.callout appearance="simple"}"""),
Markdown.parse(
"""
## `$(nameof(any))`
:::{.callout-note appearance="simple"}
"""
),
docmkd,
md":::"
)
end

function doc(mod::Module)
docmkd = process(
copy(Base.Docs.doc(mod))
)

return Markdown.MD(
docmkd
md"""
:::
"""
)
end

Expand Down

0 comments on commit b265e53

Please sign in to comment.