Skip to content

Commit

Permalink
adding documentation PDF file
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelJuillard committed Jul 31, 2024
1 parent b385812 commit f1b34d1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 21 deletions.
70 changes: 49 additions & 21 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,34 +1,62 @@
using Documenter, Dynare

# A flag to check if we are running in a GitHub action.
const _IS_GITHUB_ACTIONS = get(ENV, "GITHUB_ACTIONS", "false") == "true"

# Pass --pdf to build the PDF. On GitHub actions, we always build the PDF.
const _PDF = findfirst(isequal("--pdf"), ARGS) !== nothing || _IS_GITHUB_ACTIONS
_PAGES =[
"Home" => "index.md",
"Installation and Configuration" => "installation-and-configuration.md",
"Running Dynare" => "running-dynare.md",
"Model File" => [
"Syntax elements" => "model-file/syntax-elements.md",
"Variables and parameters declaration" => "model-file/variable-declarations.md",
"Model declaration" => "model-file/model-declaration.md",
# "Initial and terminal conditions" => "model-file/initial-terminal-conditions.md",
"Steady state" => "model-file/steady-state.md",
"Shocks on exgogenous variables" => "model-file/shocks.md",
"Deterministic simulations" => "model-file/deterministic-simulations.md",
"Local approximation" => "model-file/local-approxiation.md",
"State space, filtering and smoothing" => "model-file/filtersmoother.md",
"Estimation" => "model-file/estimation.md",
"Forecasting" => "model-file/forecasting.md",
"Reporting"=> "model-file/reporting.md",
# "Optimal policy" => "model-file/optimal-policy.md",
],
"Macroprocessing language" => "macroprocessor.md"
]

# Needed to make Documenter think that there is a PDF in the right place when
# link checking. Inn production we replace this by running the LaTeX build.
write(joinpath(@__DIR__, "src", "Dynare.pdf"), "")

makedocs(
sitename="Dynare.jl",
format=Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true"),
# doctest = false,
pages=[
"Home" => "index.md",
"Installation and Configuration" => "installation-and-configuration.md",
"Running Dynare" => "running-dynare.md",
"Model File" => [
"Syntax elements" => "model-file/syntax-elements.md",
"Variables and parameters declaration" => "model-file/variable-declarations.md",
"Model declaration" => "model-file/model-declaration.md",
# "Initial and terminal conditions" => "model-file/initial-terminal-conditions.md",
"Steady state" => "model-file/steady-state.md",
"Shocks on exgogenous variables" => "model-file/shocks.md",
"Deterministic simulations" => "model-file/deterministic-simulations.md",
"Local approximation" => "model-file/local-approxiation.md",
"State space, filtering and smoothing" => "model-file/filtersmoother.md",
"Estimation" => "model-file/estimation.md",
"Forecasting" => "model-file/forecasting.md",
"Reporting"=> "model-file/reporting.md",
# "Optimal policy" => "model-file/optimal-policy.md",
],
"Macroprocessing language" => "macroprocessor.md"
],
pages = _PAGES,
pagesonly = true,

)

latex_platform = _IS_GITHUB_ACTIONS ? "docker" : "native"
makedocs(
sitename = "Dynare",
format = Documenter.LaTeX(; platform = latex_platform),
build = "latex_build",
pages = _PAGES,
pagesonly = true,
debug = true,
)
# Hack for deploying: copy the pdf (and only the PDF) into the HTML build
# directory! We don't want to copy everything in `latex_build` because it
# includes lots of extraneous LaTeX files.
cp(
joinpath(@__DIR__, "latex_build", "Dynare.pdf"),
joinpath(@__DIR__, "build", "Dynare.pdf");
force = true,
)
deploydocs(
repo="github.com/DynareJulia/Dynare.jl.git", push_preview=true
)
2 changes: 2 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# The Dynare Julia Reference Manual
# Introduction

!!! note This documentation is also available in PDF format: [Dynare.pdf](Dynare.pdf).

DynareJulia is a rewriting of Dynare (https://www.dynare.org) that was initially written in
Gauss in 1994 and rewritten in Matlab around 2000.

Expand Down

0 comments on commit f1b34d1

Please sign in to comment.