-
Notifications
You must be signed in to change notification settings - Fork 12
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
Haddock+Hoogle for Reflex #9
Comments
Fantastic idea! |
Agreed. |
Up-to-date haddocks anywhere is a great idea. :P |
That's my way of saying 👍 |
@3noch They're in the try-reflex shell :D But on the internet would also be awesome. |
@ryantrinkle can this be generated along with the nix cache ... ? |
Haddocks are generated in the Nix builds. I know you can use $ cd reflex-platform
$ nix-shell --run "hoogle serve --local -p 8080" Having a site on reflex-frp.org that just shows this hoogle server would probably be an easy and useful way to provide docs. |
Yeah good idea! |
The |
Yes, it'd be great to have current haddocks hosted. I always run ./cache
before pushing to develop, so if someone can figure out what needs to be
added there, we can make it a policy.
…On Jun 29, 2017 03:08, "Will Fancher" ***@***.***> wrote:
The --local argument doesn't serve file:// links so it should work fine,
but the recommended way is probably the --cdn argument.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGlYFk36HDrGNrqgmqab5fYvwI4S-a1ks5sI01fgaJpZM4OBy7y>
.
|
Though the "--local" argument to hoogle will be able to serve the files directly from /nix/store path... I think the better way will be to copy the html files to a separate server (which might not even have the nix) and serve the files directly from some static dir. And another benefit is that we can have absolute paths to the haddocks for linking from docs. With --local option the paths will be like |
Isn't that what the |
Yeah but --cdn argument will require the haddocs to be hosted somewhere. So we do need to host the haddocks separately... --cdn is just a another way to do what I did in the script. I used the @url option... |
Oh I see. Using |
Not to mention, if the server this runs on is already a binary cache, then it's already arbitrarily serving those files anyway. |
Though it is possible to do it.. I think it would be better to get reflex on Hackage and use it from there. If we put links to an alternate haddock in the documentation, we will create one more dependency to manage. So I will close this .. ref: reflex-frp/reflex#75 |
See also: reflex-frp/reflex-platform#234 (comment) |
Not aware of this issue, I recently created a simple script to host up-to-date API docs on my server. I agree that docs around reflex are too spread out, so I will post the script to enable hosting the same in some better location.
Behold my bash skills! (hah, do you even know what #!/bin/bash
set -ex
############################
# system-dependent variables
# adapt as necessary
############################
GHCSHARELOC="REPLACEME" # /usr/share/ghc or whatever that is on your system
BOOTLIBLOC="$GHCSHARELOC/doc/ghc-8.0.2/html/libraries"
COMPILERVERSIONPART="x86_64-linux-ghc-8.0.2"
####
OUTPUTDIR=$(pwd)
TEMPDIR=$(mktemp -d -t haddock-gen-XXXX)
echo "using dir $TEMPDIR"
trap 'rm -r $TEMPDIR' EXIT
TEMPDIRDOCS="$TEMPDIR/doc"
mkdir "$TEMPDIRDOCS" || true
cd "$TEMPDIR"
# build stuff, generate docs
####
git clone git@github.com:reflex-frp/reflex.git
git clone git@github.com:reflex-frp/reflex-dom.git
git clone git@github.com:bennofs/reflex-host.git
cabal sandbox init
cabal install --enable-documentation --haddock-options='--hyperlinked-source'\
reflex/reflex.cabal\
reflex-dom/reflex-dom-core/reflex-dom-core.cabal\
reflex-dom/reflex-dom/reflex-dom.cabal\
reflex-host/reflex-host.cabal\
# copy bootlib and newly generated docs into one directory; fix absolute html
# references
####
cp -r -t "$TEMPDIRDOCS" -- "$BOOTLIBLOC"/*
cp -r -t "$TEMPDIRDOCS" -- "$TEMPDIR/.cabal-sandbox/share/doc/$COMPILERVERSIONPART/"/*
find "$TEMPDIRDOCS" -name "*.html" | xargs sed -i -e "s/file:\/\/${BOOTLIBLOC//\//\\\/}/..\/../g;s/file:\/\/${TEMPDIR//\//\\\/}\/.cabal-sandbox\/share\/doc\/$COMPILERVERSIONPART/..\/../g"
# also copy over our custom index.html
####
cp "$OUTPUTDIR/index.html" "$TEMPDIRDOCS"
# pack it up (switch to directory to have flat locations in the tar)
####
cd "$TEMPDIRDOCS"
tar -c -v -J -f "$OUTPUTDIR/doc.tar.xz" -- *
# todo: upload tar to server etc.
#### |
I think it would be good to have haddock hosted on github and may be updated nightly, so that we have an easy access to the latest haddock.
I intend to link haddock to the docs, so need a proper place to have the latest version.
The text was updated successfully, but these errors were encountered: