-
Notifications
You must be signed in to change notification settings - Fork 97
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
[Feature request] Support simultaneous Clojure & ClojureScript output #216
Comments
Yes, it should be relatively straightforward. Both Clojure and ClojureScript reader data could be merged before being passed to the writer. Ideally we'd also want some identifier to distinguish which functions are Clojure and ClojureScript. |
Thanks a lot for the prompt response! I'll aim then to try take a closer look at this in the next few weeks, and will update with a PR if I can figure out the details. BTW, I'll note that I think that Codox still has a really important role to fulfil in the Clojure ecosystem. Projects like cljdoc are awesome, but (IMO) offer significantly different tradeoffs. I'm personally really happy that Codox is still around and kicking after so many years of service to the community 👍 Happy weekend, cheers! :-) |
This comment was marked as outdated.
This comment was marked as outdated.
Update: have a potential implementation ready, see here for example output. Notes
|
Thanks for the detailed proposal! I think the "Platforms" section could use a little adjustment. Previously you click a link on the sidebar, and it takes you to a specific page. There's only one thing selected. But in this case the user would be selecting two things, platform and namespace, or one thing, the index or some other documentation page. One way to get around this is to treat the platform as a top-level folder, adding it above the namespace hierarchy. The problem with treating it as a folder is that I can see it being difficult to navigate for long hierarchies. For example:
Even if the ClojureScript folder is collapsed when accessing Clojure, and vice versa, you'd still need to scroll past all the Clojure namespaces to reach the ClojureScript part. The alternative is to have it as a filter, similar to to how you've set it up, but we can make it more explicit by giving it a style that indicates it's a toggle. Or perhaps a tab bar: The tabs might be a better design language, as a user expects the view below a tab bar to change when they change tabs. With a toggle, the effect is more ambiguous. What are your thoughts? |
You're very welcome, thanks for the quick + detailed response!
In principle my ordered preferences would be:
I'm not a fan of So that leaves
My 2c: Since The important thing to get right at this point IMO would be the API, and the file/link structure - since that'd hurt to break later on. I'm neutral on the layout, happy to go with your preference if you have something specific in mind 👍 BTW I've also added language labels to the var docs, with inline links to jump between languages when relevant:
|
…ptaoussanis) - This implementation attempts to be minimally invasive. Most of the logical changes are within `html/write-index` and `html/write-namespaces`, where a special path is introduced for "cross-platform" projects (= language `:both`). - NO behavioural changes are intended for traditional (non-cross-platform) projects. - See weavejester#216 for detailed feature discussion.
Note that this commit introduces new classes to `default.css` used (only) by "cross-platform" projects. This means: - NO behavioural changes are intended for non-cross-platform projects. - Cross-platform projects WILL require a theme that includes the new CSS classes.
Author: @ptaoussanis - This implementation attempts to be minimally invasive. Most of the logical changes are within `html/write-index` and `html/write-namespaces`, where a special path is introduced for "cross-platform" projects (= language `:both`). - NO behavioural changes are intended for traditional (non-cross-platform) projects. - See weavejester#216 for detailed feature discussion.
Author: @ptaoussanis - This implementation attempts to be minimally invasive. Most of the logical changes are within `html/write-index` and `html/write-namespaces`, where a special path is introduced for cross-platform projects. - NO behavioural changes are intended for traditional (non-cross-platform) projects. - See weavejester#216 for detailed feature discussion.
Author: @ptaoussanis - This implementation attempts to be minimally invasive. Most of the logical changes are within `html/write-index` and `html/write-namespaces`, where a special path is introduced for cross-platform projects. - NO behavioural changes are intended for traditional (non-cross-platform) projects. - See weavejester#216 for detailed feature discussion.
Hi James, thanks so much for all the awesome work on Codox - and so many other libraries over the years! 🙏 🙏
No urgency, but when you get an opportunity would appreciate your input on this.
I author quite a few libraries that include both a Clojure and ClojureScript API.
My understanding is that currently Codox can generate either:
{:language :clojure}
, or{:language :clojurescript}
(which includes relevant Clojure macros).But for the kinds of cross-platform libraries I'm talking about (e.g. Encore, Timbre, Sente, etc.) - it'd actually be ideal if Codox could generate API docs from the perspective of both Clojure and ClojureScript users.
From what I can tell, cljdoc handles these cases by just combining everything together. For example, here you'll see
clj
,cljs
, andclj/s
vars all visible from the same list.My 2c is it'd actually be better (and I suspect simpler) to instead require users to make a top-level choice: i.e. to browse the Clojure documentation, or the ClojureScript documentation.
I'd just like to have both available to the user.
A few motivations for this approach:
Does this make sense / seem reasonable?
Thanks so much for your time! Cheers :-)
- Peter
The text was updated successfully, but these errors were encountered: