Skip to content

Commit

Permalink
Merge pull request #7 from dklein-pik/master
Browse files Browse the repository at this point in the history
Hopefully final fixes (paths)
  • Loading branch information
tscheypidi authored Jun 25, 2020
2 parents 923f28d + 2cd9e04 commit c516eac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "goxygen: In-Code documentation for GAMS",
"version": "0.39.4",
"version": "0.39.5",
"description": "<p>A collection of tools which extract a model documentation from GAMS code and comments. In order to use the package you need to install pandoc and pandoc-citeproc first (https://pandoc.org/).<\/p>",
"creators": [
{
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: goxygen
Type: Package
Title: In-Code documentation for GAMS
Version: 0.39.4
Version: 0.39.5
Date: 2020-06-25
Authors@R: c(person("Jan Philipp", "Dietrich", email = "[email protected]", role = c("aut","cre")),
person("Kristine", "Karstens", email = "[email protected]", role = "aut"))
Expand All @@ -17,4 +17,4 @@ Suggests: testthat,
knitr,
rmarkdown
VignetteBuilder: knitr
ValidationKey: 7264572
ValidationKey: 7283010
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# In-Code documentation for GAMS

R package **goxygen**, version **0.39.4**
R package **goxygen**, version **0.39.5**

[![Travis build status](https://travis-ci.com/pik-piam/goxygen.svg?branch=master)](https://travis-ci.com/pik-piam/goxygen) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1411404.svg)](https://doi.org/10.5281/zenodo.1411404) [![codecov](https://codecov.io/gh/pik-piam/goxygen/branch/master/graph/badge.svg)](https://codecov.io/gh/pik-piam/goxygen)

Expand Down Expand Up @@ -46,8 +46,8 @@ In case of questions / problems please contact Jan Philipp Dietrich <dietrich@pi

To cite package **goxygen** in publications use:

Dietrich J, Karstens K (2020). _goxygen: In-Code documentation for GAMS_. doi: 10.5281/zenodo.1411404 (URL:
https://doi.org/10.5281/zenodo.1411404), R package version 0.39.4, <URL: https://github.com/pik-piam/goxygen>.
Dietrich J, Karstens K (2020). _goxygen: In-Code documentation for GAMS_. doi: 10.5281/zenodo.1411404 (URL: https://doi.org/10.5281/zenodo.1411404), R
package version 0.39.5, <URL: https://github.com/pik-piam/goxygen>.

A BibTeX entry for LaTeX users is

Expand All @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is
title = {goxygen: In-Code documentation for GAMS},
author = {Jan Philipp Dietrich and Kristine Karstens},
year = {2020},
note = {R package version 0.39.4},
note = {R package version 0.39.5},
doi = {10.5281/zenodo.1411404},
url = {https://github.com/pik-piam/goxygen},
}
Expand Down
20 changes: 8 additions & 12 deletions vignettes/goxygen.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,21 @@ Goxygen can extract the documentation from plain GAMS code (see next section) or

## Running goxygen on plain GAMS code

We take the GAMS code example from this package and save it to `tmp-plain.gms`:
We take the GAMS code example from this package and save it to `dummymodel-plain`:

```{r eval=FALSE}
# create temporary folder for the plain GAMS model
dir.create("tmp-plain")
# copy the folder containing a simple dummy model with goxygen comments
file.copy(from = system.file("dummymodel-plain",package="goxygen"), to = "tmp-plain", recursive = TRUE)
file.copy(from = system.file("dummymodel-plain",package="goxygen"), to = ".", recursive = TRUE)
```

and execute `goxygen` on this GAMS file to produce the documentation in html format. If you want the documentation in pdf format simply set `output = "pdf"`.

```{r eval=FALSE}
library(goxygen)
goxygen(path = "tmp-plain", mainfile = "0_main.gms", output = "html", cff = "HOWTOCITE.cff")
goxygen(path = "dummymodel-plain/", mainfile = "0_main.gms", output = "html", cff = "HOWTOCITE.cff")
```

Goxygen now searches the code for all lines starting with the goxygen tag "*'", interpretes the goxygen identifiers, and compiles the documentation into the format specified (html, tex, pdf). Please find the goxygen output in the folder `tmp-plain/doc`.
Goxygen now searches the code for all lines starting with the goxygen tag "*'", interpretes the goxygen identifiers, and compiles the documentation into the format specified (html, tex, pdf). Please find the goxygen output in the folder `dummymodel-plain/doc`.

## Goxygen syntax

Expand Down Expand Up @@ -91,18 +89,16 @@ This was a simple example of a GAMS model in a single file with a plain structur
Goxygen is tailored to extract the documentation from this modular structure and to compile it to a clearly arranged documentation. Goxygen identifies modules and their interfaces, generates a interface plots that depict the interactions between modules, and lists the inputs and outputs of modules. For each module goxygen creates a new chapter in the documentation. We will demonstrate this using the simple example model from the `gms` package:

```{r eval=FALSE}
# create a temporary folder for the modularized GAMS model
dir.create("tmp-modular")
# copy all files and folders containing the modular dummy model
file.copy(from = system.file("dummymodel",package="gms"), to = "tmp-modular", recursive = TRUE)
file.copy(from = system.file("dummymodel",package="gms"), to = ".", recursive = TRUE)
```

Now execute `goxygen` on the modular GAMS model:

```{r eval=FALSE}
goxygen(path = "tmp-modular/dummymodel", output = "html", cff = "HOWTOCITE.cff")
goxygen(path = "dummymodel/", output = "html", cff = "HOWTOCITE.cff")
```

Please find the goxygen output in the folder `tmp-modular/dummymodel/doc`.
Please find the goxygen output in the folder `dummymodel/doc`.

## References

0 comments on commit c516eac

Please sign in to comment.