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

add support for using existing Dash.app docsets #53

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ which aptly characterizes the terminal environment where everything is text.

* Keep [Dash] docsets anywhere you like.

* Access existing docset library managed by Dash.app (MacOS only).

### Preview

Watch the "[dasht in a terminal](https://vimeo.com/159462598)"
Expand Down Expand Up @@ -61,6 +63,8 @@ Optional:

* [gawk] for dasht-server(1) search engine

* [Dash] to let the Dash MacOS app manage your docsets

Development:

[binman]: https://sunaku.github.io/binman/
Expand Down Expand Up @@ -91,6 +95,15 @@ Manually, on any system:

export MANPATH=location_where_you_cloned_or_downloaded_dasht/man:$MANPATH

### Dash.app integration

Set `DASHT_USE_DASH_APP=true` to use the docsets stored by Dash.app on your
machine. This makes `dasht` act like a read-only client for your Dash.app
docset library-- all docset management commands (`install`, `update`, `remove`)
are disabled. This also provides access to an expanded library of docsets,
because currently `dasht` can only download and/or build a subset of the
docsets available through Dash.app.

### Vim integration

Use the [vim-dasht](https://github.com/sunaku/vim-dasht) plugin for (Neo)Vim.
Expand Down Expand Up @@ -142,6 +155,11 @@ which defines the filesystem location where download links are cached.
If undefined, its value is assumed to be `$XDG_CACHE_HOME/dasht/`
or, if `XDG_CACHE_HOME` is also undefined, `$HOME/.cache/dasht/`.

Set `DASHT_USE_DASH_APP=true` to enable Dash.app integration (MacOS only). See
[Dash.app integration](#dashapp-integration) for details. Note that this will
also change the default setting of `DASHT_DOCSETS_DIR` to `~/Libary/Application
Support/Dash` (where Dash.app docsets are stored by default).

## Development

If you make changes to the embedded manual pages found in the comment headers
Expand Down
18 changes: 18 additions & 0 deletions bin/dasht
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 44
Expand All @@ -67,11 +72,24 @@
# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku/dasht>
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_USE_DASH_APP:=false}
if $DASHT_USE_DASH_APP; then
: ${DASHT_DOCSETS_DIR:="$HOME/Library/Application Support/Dash"}
else
: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
fi

if test $# -gt 0; then
pattern=$1
shift
fi

# Ensure any docsets we are accessing from the Dash.app library have had their
# documents extracted. Dash.app leaves the documents in the tarball by default.
if $DASHT_USE_DASH_APP; then
dasht-docsets-inherit "$@"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good refactoring, but I don't think dasht should be calling the dasht-docsets-inherit script at all -- that should be left up to the user to run, if they choose. So I would remove this entire if-statement from dasht.

fi

count=$(dasht-docsets "$@" | wc -l)
if test $count -eq 0; then
# notify user when no docsets are installed so they can go install them
Expand Down
22 changes: 20 additions & 2 deletions bin/dasht-docsets
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## SEE ALSO
#
# dasht-docsets-install(1), dasht-docsets-update(1), dasht-docsets-remove(1),
Expand All @@ -46,9 +51,22 @@
# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku/dasht>
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
: ${DASHT_USE_DASH_APP:=false}
if $DASHT_USE_DASH_APP; then
: ${DASHT_DOCSETS_DIR:="$HOME/Library/Application Support/Dash"}
else
: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
fi

ls "$DASHT_DOCSETS_DIR" |
{
if $DASHT_USE_DASH_APP; then
for x in "$DASHT_DOCSETS_DIR"/*/*/*.docset; do
basename "$x"
done
else
ls "$DASHT_DOCSETS_DIR"
fi
} |
sed -n 's/\.docset$//p' |
sort -u |
grep -E -i "$(IFS='|'; echo "$*")"
30 changes: 29 additions & 1 deletion bin/dasht-docsets-extract
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 46
# Command was not executed because `DASHT_USE_DASH_APP` is set.
#
# ## SEE ALSO
#
# dasht-docsets-install(1), dasht-docsets-update(1), [Dash]
Expand All @@ -50,10 +60,28 @@
# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku/dasht>
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
: ${DASHT_USE_DASH_APP:=false}
if $DASHT_USE_DASH_APP; then
: ${DASHT_DOCSETS_DIR:="$HOME/Library/Application Support/Dash"}
else
: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
fi

test $# -gt 0
for tgz; do

# Extract Documents dir inside existing Dash.app docset directory. Dash.app
# leaves the Documents inside the tarball tarix.tgz by default.
if $DASHT_USE_DASH_APP; then
pushd "$(dirname "$tgz")" >/dev/null
docset_name="$(basename "${tgz%/*/*/*}")"
tar -x -f "$tgz" "$docset_name/Contents/Resources/Documents"
mv "$docset_name/Contents/Resources/Documents" .
rm -r "$docset_name"
popd >/dev/null
continue
fi

want="$DASHT_DOCSETS_DIR/$(basename "$tgz" .tgz).docset"
have="$DASHT_DOCSETS_DIR/$(tar -t -f "$tgz" -z | head -1 | sed 's|/.*||')"

Expand Down
72 changes: 72 additions & 0 deletions bin/dasht-docsets-inherit
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh -e
#
# # DASHT-DOCSETS-INHERIT 1 2020-05-16 2.4.0
#
# ## NAME
#
# dasht-docsets-inherit - unpack docsets from Dash.app
#
# ## SYNOPSIS
#
# `dasht-docsets-inherit` [*NAME*...]
#
# ### Examples
#
# `dasht-docsets-inherit`
# Unpack all installed Dash.app docsets.
#
# `dasht-docsets-inherit` sh
# Unpack Dash.app docsets whose names contain "sh".
#
# `dasht-docsets` sh 'c$'
# Unpack Dash.app docsets whose names contain "sh" or end in "c".
#
# ## DESCRIPTION
#
# Unpack specified Dash.app docsets. This is necessary to use the Docsets with
# `dasht`. Docsets are specified by passing one or more name filters as
# arguments, which are matched against docset names. If no filters are
# specified, all docsets are unpacked. Note that `DASHT_USE_DASH_APP` must be
# set to `true` for this script to execute.
#
# ## ENVIRONMENT
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 44
# No results were found.
# 46
# Command was not executed because `DASHT_USE_DASH_APP` is not set.
#
# ## SEE ALSO
#
# dasht-docsets(1), [Dash]
#
# [Dash]: https://kapeli.com/dash
#
# ## AUTHOR
#
# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku/dasht>
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_USE_DASH_APP:=false}
if $DASHT_USE_DASH_APP; then
: ${DASHT_DOCSETS_DIR:="$HOME/Library/Application Support/Dash"}
Copy link
Owner

@sunaku sunaku Jul 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the user to set the DASHT_USE_DASH_APP flag; this inheritance script should simply inherit from Dash for macOS if it's found. This would pave the way for further enhancement of this script in the future, say, to inherit from additional sources such as Zeal docsets and custom user docsets.

else
exit 46
fi

# Ensure any docsets we are accessing from the Dash.app library have had their
# documents extracted. Dash.app leaves the documents in the tarball by default.
dasht-docsets "$@" | while read docset; do
for root in "$DASHT_DOCSETS_DIR"/*/*/"$docset".docset; do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think $DASHT_DOCSETS_DIR shouldn't be redefined, because the user may have set it to something special. Instead, the loop should try looking in $HOME/Library/Application Support/Dash (which can be factored out as follows).

KAPELI_DASH_DIR="$HOME/Library/Application Support/Dash"
# ...
if test -e "$KAPELI_DASH_DIR"; then
  for root in "$KAPELI_DASH_DIR"/*/*/"$docset".docset; do
    # ...

Copy link
Contributor Author

@smackesey smackesey Jul 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably better for you to make the changes, because it seems like we have somewhat different architectural ideas about the interface, and I think if I made just the changes you requested, it would leave the project with a weird mixture-- if you want to move in the requested direction, you'll probably need to adjust some of my other changes as well. So I'll explain the overall design I followed, then you can do what you want with it.

When making my changes, this was my thinking: the user is using dasht in one of two "modes": regular mode or Dash.app mode. Dash.app mode is activated by setting the DASHT_USE_DASH_APP flag. All of the other scripts dealing with docset management (install,extract,remove,update) behave conditionally on this flag-- that is why dasht-docsets-inherit does as well, it would be weird to have only script that didn't.

Similarly, dasht-docsets-inherit just follows the behavior of the other scripts re DASHT_DOCSETS_DIR as well-- it sets a default value, the macOS location (so a user setting would not be changed). In general, I don't expect people to simultaneously set DASHT_DOCSETS_DIR and DASHT_USE_DASH_APP-- the exception is if Dash.app is in some exotic location.

I was also a bit confused by the name dasht-docsets-inherit that you requested. To me, this suggests a kind of transferring of Dash.app docsets into dasht, e.g. Dash.app docsets would be copied over and extracted into the dedicated DASHT_DOCSETS_DIR directory. If that were the case, I would understand why you wouldn't want this called in the main dasht executable-- it would be a kind of separate import operation. But this is not how it works at present. All dasht-docsets-inherit does is perform in-place extraction of Dash.app docsets within their existing directory. This is a one-time operation that is necessary when accessing Dash.app docsets. Given the current design, I don't understand the rationale for running this separately. As it is, if the user downloads some datasets in Dash.app, they are seamlessly available in dasht. But if you make them run dasht-docsets-inherit separately, then every time they download a new Dash docset, they have to remember to run dasht-docsets-inherit, for no benefit that I can see.

It seems to me that your vision is better suited to a system where, rather than having Dash.app mode and regular mode (as I designed it), dasht always just reads from it's own dedicated docset database/directory, and you can import into this directory from either Dash.app or Zeal/custom whatever. That sounds like a good design, but that implies bigger changes (removing DASHT_USE_DASH_APP entirely).

Copy link
Owner

@sunaku sunaku Jul 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well said! 💯 You've understood my vision correctly and, thanks to your clear explanation, I now realize that I didn't quite understand your approach in this PR until now. 😅 Let me think more about how to reconcile our different approaches. 🤔

One of the reasons for my knowledge gap is that I don't have access to (and have never actually used) the Dash for macOS app firsthand. So I don't know how Dash organizes its docsets on the filesystem nowadays, other than from a helpful (but now possibly outdated) user-provided tip in #15 (comment).

In particular, since you intended to extract Dash's docsets directly within its own internal area (as opposed to dasht's DASHT_DOCSETS_DIR area), I'm wondering how Dash operates: 🤔 it either has its own internal area where it extracts docset tarballs (in which case, couldn't we just point to that instead of re-extracting for dasht?) or it has some kind of virtual filesystem adapter that dynamically exposes the contents of docset tarballs as if they were normal extracted files on disk.

I'm intrigued by the latter possibility 🤓 and am curious to try implementing a very basic, shell scripted version thereof. A direct consequence of this would be that dasht would need to become web-server based by default, since direct file access can't be intercepted by mere shell scripts: that would require a real VFS, which is beyond the scope of this project.

Could you help me understand how Dash organizes its docsets on your system? A simple diagram, such as the output of the tree command, as exemplified in #15 (comment)), would be sufficient. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad I could clear things up!

Since the initial work on this was done close to a year ago, I don't remember everything I learned about Dash.app's internal organization of docsets when I started work on this, but I remember being surprised that I couldn't find extracted versions of the docsets in Dash's saved data. I don't know how it accesses the tarball content, I assumed it uses some library I was unaware of for reading tarballs directly, and since this was a shell script project, I didn't investigate further.

Here's an example of the structure of a DocSet as Dash stores it:

── SciPy.docset
    └── Contents
        ├── Info.plist
        └── Resources
            ├── docSet.dsidx
            ├── optimizedIndex.dsidx
            ├── tarix.tgz
            └── tarixIndex.db

And attached is the full output of ~/Library/Application Support/Dash.
tree.txt

Copy link
Owner

@sunaku sunaku Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed report! 🙇 There seems to be a mixture of fully extracted docsets (which is what dasht currently uses) as well as unextracted tarix.tgz ones.

Could you inspect the tarixIndex.db file further? I'm thinking that it's either a repackaged version of tarix.tgz (to avoid the overhead of gunzip before accessing the contents of the underlying tar) or a searchable index thereof (to avoid the same gunzip overhead, but meant for traversing the underlying tar). 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That mixture is there because I use my fork of dasht, which does the extraction in place on-demand. I haven't searched every docset in my Dash library with dasht, so not every docset is extracted.

Here's a link to a tarixIndex.db file, it's a SQLite database (Github won't let me attach this file type directly to the issue). https://file.io/1Lsva6fX1MLA

if ! test -d "${root}/Contents/Resources/Documents"; then
dasht-docsets-extract "$root/Contents/Resources/tarix.tgz"
fi
done
done
17 changes: 17 additions & 0 deletions bin/dasht-docsets-install
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
# If undefined, its value is assumed to be `$XDG_CACHE_HOME/dasht/`
# or, if `XDG_CACHE_HOME` is also undefined, `$HOME/.cache/dasht/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 46
# Command was not executed because `DASHT_USE_DASH_APP` is set.
#
# ## SEE ALSO
#
# dasht-docsets-extract(1), dasht-docsets-update(1), dasht-docsets-remove(1),
Expand All @@ -58,6 +68,13 @@

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
: ${DASHT_CACHE_DIR:=${XDG_CACHE_HOME:-$HOME/.cache}/dasht}
: ${DASHT_USE_DASH_APP:=false}

if $DASHT_USE_DASH_APP; then
echo "extract, install, remove, and update operations are disabled when \
DASHT_USE_DASH_APP=true." >&2
exit 46
fi

test "$1" = '-f' -o "$1" = '--force' && force=1 && shift || unset force

Expand Down
19 changes: 19 additions & 0 deletions bin/dasht-docsets-remove
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 46
# Command was not executed because `DASHT_USE_DASH_APP` is set.
#
# ## SEE ALSO
#
# dasht-docsets-install(1), dasht-docsets-update(1), dasht-docsets(1), [Dash]
Expand All @@ -50,6 +60,15 @@
# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku/dasht>
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
: ${DASHT_USE_DASH_APP:=false}

if $DASHT_USE_DASH_APP; then
echo "extract, install, remove, and update operations are disabled when \
DASHT_USE_DASH_APP=true." >&2
exit 46
fi

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}

test "$1" = '-f' -o "$1" = '--force' && force=1 && shift || unset force
Expand Down
17 changes: 17 additions & 0 deletions bin/dasht-docsets-update
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 46
# Command was not executed because `DASHT_USE_DASH_APP` is set.
#
# ## SEE ALSO
#
# dasht-docsets-extract(1), dasht-docsets-install(1), dasht-docsets-remove(1),
Expand All @@ -46,6 +56,13 @@
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
: ${DASHT_USE_DASH_APP:=false}

if $DASHT_USE_DASH_APP; then
echo "extract, install, remove, and update operations are disabled when \
DASHT_USE_DASH_APP=true." >&2
exit 46
fi

dasht-docsets "$@" | while read -r docset; do
ls "$DASHT_DOCSETS_DIR/$docset"*.tgz
Expand Down
5 changes: 5 additions & 0 deletions bin/dasht-query-html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 44
Expand Down
19 changes: 17 additions & 2 deletions bin/dasht-query-line
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## EXIT STATUS
#
# 44
Expand All @@ -86,7 +91,12 @@
# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku/dasht>
# Distributed under the terms of the ISC license (refer to README file).

: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
: ${DASHT_USE_DASH_APP:=false}
if $DASHT_USE_DASH_APP; then
: ${DASHT_DOCSETS_DIR:="$HOME/Library/Application Support/Dash"}
else
: ${DASHT_DOCSETS_DIR:=${XDG_DATA_HOME:-$HOME/.local/share}/dasht/docsets}
fi

pattern=$(echo " $1 " | sed -e 's/[%_]/\\&/g' -e 's/[[:space:]]\{1,\}/%/g')
test $# -gt 0 && shift # shift off PATTERN so argv contains solely DOCSETs
Expand All @@ -95,7 +105,12 @@ status=44 # (default) exit with a nonzero status when no results are found
trap 'status=0' USR1 # override default exit status when results are found

dasht-docsets "$@" | while read -r docset; do
database="$DASHT_DOCSETS_DIR/$docset".docset/Contents/Resources/docSet.dsidx
if $DASHT_USE_DASH_APP; then
relpath=("$DASHT_DOCSETS_DIR"/*/*/"$docset".docset)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the ( array ) notation? Should be removed.

database="$relpath/Contents/Resources/docSet.dsidx"
else
database="$DASHT_DOCSETS_DIR/$docset".docset/Contents/Resources/docSet.dsidx
fi
file_url="file://$(dirname "$database")/Documents/"

dasht-query-exec "$pattern" "$database" -line |
Expand Down
5 changes: 5 additions & 0 deletions bin/dasht-server
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
# If undefined, its value is assumed to be `$XDG_DATA_HOME/dasht/docsets/`
# or, if `XDG_DATA_HOME` is undefined, `$HOME/.local/share/dasht/docsets/`.
#
# `DASHT_USE_DASH_APP`
# Set to "true" to use Dash.app's (MacOS only) docset library. Disables
# docset management commands (install, remove, update). Also changes the
# default `DASHT_DOCSETS_DIR` to "~/Library/Application Support/Dash".
#
# ## SEE ALSO
#
# socat(1), dasht-server-http(1), dasht-docsets(1), dasht(1), [Dash]
Expand Down
Loading