Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Relative URL paths in STHLP help files

    Hello everyone,

    I am trying to write documentation for a Stata project I'm finishing. Suppose I distribute the project to my coworkers as a ado command "myproject.ado", the corresponding "myproject.sthlp" help file, and a "myproject_resources" folder containing various do-files necessary to the project, and HTML documentation files. I tell my coworkers (and the future users) to drop the two files and the folder anywhere on their ado path.

    For a typical user, the directory structure would look like this:

    Code:
    C:/ado/personal/
            myproject.ado
            myproject.sthlp
            myproject_resources/
                    method_1.do
                    method_2.do
                    more_doc.html
    Now, in the STHLP file, I would like to include links to the HTML documentation inside the "myproject_resources" folder. If the STHLP was simply an HTML file, I would just use the relative path to the desired file, something like:

    Code:
    {browse "./myproject_resources/more_doc.html": More documentation}
    Unfortunately, it does not seem to work in sthlp files. Even worse, I can't even use relative paths from the c(pwd) directory, it seems. I've only made it work with absolute paths so far.

    Do you know a way to use relative paths in STHLP files to include links to local HTML files? Thank you very much.

    edit: tags

  • #2
    I made a small mistake. It does indeed work when using paths relative to the pwd path (cd). I therefore reframe my question:

    1) Is there a way to use paths relative to the STHLP file rather than relative to c(pwd) path?
    2) If not, is there a way I can change the current path when calling a help file?

    Thank you very much.

    Comment

    Working...
    X