This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # babashka (18)
- # babashka-sci-dev (42)
- # beginners (84)
- # calva (11)
- # cider (5)
- # clj-kondo (11)
- # cljdoc (70)
- # cljs-dev (34)
- # clojure-europe (1)
- # clojurescript (3)
- # conjure (1)
- # core-async (29)
- # data-oriented-programming (10)
- # emacs (13)
- # fulcro (8)
- # gratitude (2)
- # honeysql (1)
- # introduce-yourself (4)
- # kaocha (10)
- # missionary (8)
- # nrepl (4)
- # off-topic (27)
- # portal (32)
- # releases (11)
- # tools-deps (11)
- # xtdb (19)
I think I’ve mostly finished my cljdoc article styling efforts for now. It was mostly an effort to fill in the gaps for AsciiDoc articles (and close some issues I had opened almost 3 years ago!) Things look mucho better to me, but please do let me know if you find something that is not rendering as you would expect.
it's supposed to break down articles by section and deep-link but I broke that somehow
@U02N27RK69K when you get your 2nd (3rd? nth?) wind, lemme know. Maybe I can help to make those sections easier to find for both adoc and md.
the problem itself isn't particularly difficult. we need to find all the header tags with ids and the text between the headers is paired with the header before it
I’m sure we could make it less brittle. I think you were looking at resulting HTML to find sections? Are you just wanting to breakdown by toplevel sections or are you looking at nested sections too?
nested sections? and yeah I was using the rendered html because I need whatever the library generates for the header id
By nested mean like: • header1 ◦ some content ◦ header1.1 (nested) ▪︎ moar content • header1.1.1 (nested) ◦ more stuff • header2 ◦ header2 content If I search for stuff, would I match header1.1.1 or header1?
Yeah, caching can come when we see a need for it, I guess. Cljdoc does what seems to me a ton of rework for repeated requests. But maybe we don’t care at this point.
I don't see why people shouldn't get to as close as possible to what they searched
we could cache longer without causing much issue now that we also have a version number
Hmmm… I just recently added https://github.com/cljdoc/cljdoc/pull/601… Just looking at how these currently render today: md:
<h2><a href="#formatting-marks" id="formatting-marks" class="md-anchor">Formatting marks</a></h2>
<h2 id="_formatting_marks"><a class="link" href="#_formatting_marks">Formatting marks</a></h2>
class md is a https://github.com/cljdoc/cljdoc/blob/7fc7f513a94785d2247b673ff9db4cc6d667dffe/src/cljdoc/render/rich_text.clj#L98…. If adding some markers would make it easier to do what you need to do, I think we could do that.
(if you need another set of eyes) (or are burnt out on search!) happy to do it if it would be helpful
if you'd like! I'm at family stuff all weekend so can't really do much with it
Oh I see… your elegant code is not being invoked https://github.com/cljdoc/cljdoc/blob/7fc7f513a94785d2247b673ff9db4cc6d667dffe/src/cljdoc/render/api_searchset.clj#L100-L103
(:cljdoc.doc/type doc) will always return nil because that key is down under a doc’s
Ya, I expect! I’ll fiddle and see.
Not sure why we have that
:attrs subkey… but that’s a question for another day!
Yep, your code is breaking down .md by sections with a wee fix. And it would not take much more for it to also handle .adoc, (now that we have that recent change).
Yeah I could take a crack at it, unless the fix would bring you some pleasure/fun/joy? (I’d not want to steal that from you, but am also at the same time, happy to help!) If if do this, should I bump some client version cache thingy, to force a client-side update?
you could bump this version if you want but the cache only is around for a day so it's nbd if not https://github.com/cljdoc/cljdoc/blob/master/js/single-docset-search.tsx#L11
Ok started to take a peek. A little complication is that the html for adoc sections is nested. Ex. sect3 div is within sect2 div is within sect1 div. This is not the case for html for md which has a flat structure. I’m sure I can sort it out. I’ll take another peek tomorrow.
I hope I have not trounced too badly on your beautiful code! I’m a little bleary eyed, so won’t merge just yet. https://github.com/cljdoc/cljdoc/pull/616?
And thanks for the PR review, mucho appreciated! I'll merge tomorrow, I don't have enough pep left tonight to recover should anything go sideways!