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

Refine for cljdoc/codox #34

Merged
merged 11 commits into from
Dec 2, 2021
Merged

Conversation

lread
Copy link
Contributor

@lread lread commented Dec 1, 2021

Lemme know what you think. Details in commits.

Closes #28
(Does not include adding :keys destructuring to fn signatures as I felt these were noisy when reading docs on cljdoc, but you may want them still for other reasons).

To complete the story for cljdoc we'll also likely want to address #33 so that we can get our pom scm info correct.

@lread
Copy link
Contributor Author

lread commented Dec 1, 2021

If you want to preview what docs will look like in cljdoc, you can try the following:

Terminal 1: launch a cljdoc server (leave this running)

docker pull cljdoc/cljdoc
mkdir -p /tmp/cljdoc
docker run --rm \
  --publish 8000:8000 \
  --volume "$HOME/.m2:/root/.m2" \
  --volume /tmp/cljdoc:/app/data \
  cljdoc/cljdoc

Terminal 2: import lib into cljdocs

clojure -X:jar
clojure -X:install
docker run --rm \
  --volume "$HOME/.m2:/root/.m2" \
  --volume /tmp/cljdoc:/app/data \
  --entrypoint clojure \
  cljdoc/cljdoc -M:cli ingest \
    --project com.phronemophobic/membrane.term \
    --version 0.9.0 \
    --git https://github.com/phronmophobic/membrane.term \
    --rev $(git rev-parse HEAD)

Browser: open http://localhost:8000/d/com.phronemophobic/membrane.term

Note: This preview does compensate for any broken pom scm.

Full cljdoc preview docs are here.

@phronmophobic
Copy link
Owner

(Does not include adding :keys destructuring to fn signatures as I felt these were noisy when reading docs on cljdoc, but you may want them still for other reasons).

I find the keys destructuring useful since it shows up as I type in my editor.
When I add the :keys, then it shows up like this rather than just run-term [opts]
Screen Shot 2021-12-01 at 11 37 04 AM

I use the documentation in my editor much more than cljdoc so I'd prefer trying to get cljdoc to match my workflow than the other way around.

I don't have docker set up or another easy way to test how things look on cljdoc at the moment (but I'm working on it!). If :keys is noisy on cljdoc, is there a way to improve that on cljdoc's end? I'm always curious about others' workflows. Do other people not find that generally useful?

@(requiring-resolve 'membrane.java2d/toolkit))

(def default-color-scheme
(def ^:private default-color-scheme
Copy link
Owner

Choose a reason for hiding this comment

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

This seems like it would be useful to make public.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, good observation. I shall make it so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to leave this one private and expose run-term and screenshots opts instead.
They both include default-color-scheme.

Copy link
Owner

Choose a reason for hiding this comment

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

I tend to lean more on the open side for these types of things, especially if they're just data. What's the reason for not making this public?

Copy link
Contributor Author

@lread lread Dec 2, 2021

Choose a reason for hiding this comment

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

My thinking:

  • we are covered because it is included in both default-run-term-opts and default-screenshot-opts
  • it is added to cljdoc docs, and thought it might be superfluous.

But... can easily expose it if that makes more sense to you. I have no strong feeling on the matter. If it will be useful to you or others, let's expose it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@phronmophobic lemme know your choice on this one, and I shall make it so.

Copy link
Owner

Choose a reason for hiding this comment

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

To me, it makes sense to expose it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good sir! It is done.

@lread
Copy link
Contributor Author

lread commented Dec 1, 2021

re: :keys destructuring in fn signature: I might be focused too much on what looks pretty to me in cljdoc. I'll add in the destructuring.

@lread
Copy link
Contributor Author

lread commented Dec 1, 2021

I don't have docker set up or another easy way to test how things look on cljdoc at the moment (but I'm working on it!). If :keys is noisy on cljdoc, is there a way to improve that on cljdoc's end? I'm always curious about others' workflows. Do other people not find that generally useful?

I think it might be a good hint if you remember what the values for the keys should be.
But my memory is not great, and I typically have to go to the docstring to get the details anyway.

Acts as documentation only.
This provides useful reminders of possible opts keys in many IDEs.
@lread
Copy link
Contributor Author

lread commented Dec 1, 2021

Ya I guess it doesn't look too bad in cljdoc:

image

lread added 2 commits December 1, 2021 17:49
- run-term options restated in screenshot docstring
- toolkit option description corrected
- options described in same order a they appear in fn signature
@lread
Copy link
Contributor Author

lread commented Dec 1, 2021

Ok @phronmophobic, took a shot at responding to your feedback, when you have time/interest, ready for next review.

@phronmophobic
Copy link
Owner

Cool. I'll take a look. Hopefully, these comments don't seem too nit-picky!

@lread
Copy link
Contributor Author

lread commented Dec 2, 2021

Hopefully, these comments don't seem too nit-picky!

Nah, I'm cool. I really enjoy learning from the perspective of others.
All of your points seem like valid paths to me.
There are many right answers, but this is your library, so you should be happy with what goes into it!

@phronmophobic
Copy link
Owner

Everything looks good to me 👍 . I'll just wait on making default-color-scheme or I can make the change if that's easier. Thanks!

@lread
Copy link
Contributor Author

lread commented Dec 2, 2021

Ok, ready for another review and potentially a merge!

@phronmophobic phronmophobic merged commit f6d59d7 into phronmophobic:main Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve docs for run-term and screenshot
2 participants