Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's always three lines for every function #276

Closed
bbbales2 opened this issue Oct 21, 2020 · 5 comments
Closed

There's always three lines for every function #276

bbbales2 opened this issue Oct 21, 2020 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@bbbales2
Copy link
Member

Summary:

This line renders:

`real` **`normal_lpdf`**`(reals y | reals mu, reals sigma)`<br>\newline

And that's great.

Do these two lines do anything? How do I know I've done them right? Can I delete them?

<!-- real; normal_lpdf; (reals y | reals mu, reals sigma); -->
\index{{\tt \bfseries normal\_lpdf }!{\tt (reals y \textbar\ reals mu, reals sigma): real}|hyperpage}

Current Version:

v2.24.0

@bbbales2 bbbales2 added the question Further information is requested label Oct 21, 2020
@rok-cesnovar
Copy link
Member

rok-cesnovar commented Oct 21, 2020

I believe at least the HTML comment (the first of the two lines) is used for parsing the stan-functions.txt which is consumed by emacs stan-mode #180 and I believe also rstudio stan-dev/stan#2740

I am not sure about the second line though.

@bbbales2
Copy link
Member Author

Ooops, I need to add the html ones back to the ode functions then

@mitzimorris
Copy link
Member

Do these two lines do anything? How do I know I've done them right? Can I delete them?

\index{{\tt \bfseries normal_lpdf }!{\tt (reals y \textbar\ reals mu, reals sigma): real}|hyperpage}

hi @bbbales2 (can I call you b3n? b3n2?). these are great questions which need to be documented somewhere - like a wiki page on "all the hacks that go into the docset" -

line 1 is used by script https://github.com/stan-dev/docs/blob/master/extract_function_sigs.py
and this script is used by the folks at RStudio to produce a listing of all Stan math functions available to the user.

line 2 is used by Latex so that the pdf version of the docs has an index.

they are both entirely very necessary.

@mitzimorris
Copy link
Member

(maybe you know this) - the hack here is that when rendering pdfs via Latex, html directives are ignored, and when rendering html pages via bookdown, latex directives are ignored. so the Rmd files are cluttered up w/ crap.

when I converted the latex version of the functions ref manual to Rmd, I somehow generated the HTML comments from the Latex index directives via Python scripts. I think I could do something similar again to get the _lupmf entries.

@bbbales2
Copy link
Member Author

Oooo, alright, makes sense. I did not know this.

mitzimorris added a commit that referenced this issue Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants