# \[ANN\] PkgOnlineHelp: Quickly browse package documentation web sites from the REPL

**URL:** <https://discourse.julialang.org/t/ann-pkgonlinehelp-quickly-browse-package-documentation-web-sites-from-the-repl/83675>\
**Category:** Package Announcements\
**Tags:** package, documentation, website\
**Created:** [July 2, 2022, 11:17pm UTC](https://discourse.julialang.org/t/ann-pkgonlinehelp-quickly-browse-package-documentation-web-sites-from-the-repl/83675 "2022-07-02T23:17:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [July 2, 2022, 11:17pm UTC](https://discourse.julialang.org/t/ann-pkgonlinehelp-quickly-browse-package-documentation-web-sites-from-the-repl/83675/1 "2022-07-02T23:17:15Z")

</div>

# Description

[PkgOnlineHelp](https://github.com/simonp0420/PkgOnlineHelp.jl) is a small package that enables browsing to package documentation sites or other web sites by entering just a few keystrokes at the REPL. It addresses the problem mentioned in [this](https://discourse.julialang.org/t/easy-way-to-reach-online-documentation/83462/1) thread where one often needs to refer to web-based documentation that is more detailed than the “doc string” help already available at the REPL.

# Usage

The main convenience macro provided by the package is `@docs`. Here is an example of usage:

```julia
julia> using PkgOnlineHelp # If not included in your startup.jl

julia> @docs StaticArrays
"https://github.com/JuliaArrays/StaticArrays.jl.git"

```

The `StaticArrays` repo site is returned and opened in the browser. By default, when invoked with a package name as shown above, `@docs` will return and open the package’s repo web site. However, this site choice can be overridden via a call to `add_pkg_docs` as shown below. In the above case, the repo site was determined by searching through all Julia registries in `DEPOT_PATH`, implying that unregistered packages will not be found, by default.

However, `@docs` can also be used to access unregistered packages or even arbitrary web sites. For example, suppose you wish to have rapid access to the portion of the online Julia documentation discussing macros. Then you would enter (one time only) the following at the Julia prompt:

```julia
julia> add_pkg_docs("macros", "https://docs.julialang.org/en/v1/manual/metaprogramming/#man-macros")

```

Later in this Julia session, or in any future session, the site can be quickly opened by entering

```julia
julia> @docs macros

```

Of course, this example assumes that `using PkgOnlineHelp` has already been entered.

Similarly, entering

```julia
julia> add_pkg_docs("StaticArrays", "https://juliaarrays.github.io/StaticArrays.jl/stable/")

```

will cause future invocations of `@docs StaticArrays` to open the hosted documentation for the package, rather than the repo site.

Each call to `add_pkg_docs` adds an entry to a tiny TOML database file stored in a [Scratch](https://github.com/JuliaPackaging/Scratch.jl) space, providing permanence across Julia sessions.

The contents of the `PkgOnlineHelp` database can be shown by typing `list_pkg_docs()` at the REPL prompt. Items can be removed using, e.g. `remove_pkg_docs("macros")`.

# Discussion

I expect that eventually a similar capability will be incorporated directly in Julia or its package manager. In the meantime, this is my modest attempt to give back something of general utility to the Julia community. Enjoy! – Peter
