docs

About docs of Clojure & libs
2017-12-08T20:54:28.000241Z

I have been doing some brain storming on how to make more understandable software. I’m trying to turn those ideas into something actionable, maybe a clojure library. The current idea is to give projects more of a narrative. I wrote up a quick proposal of what this might look like here: https://github.com/drewverlee/narrative/blob/master/ideas.md I welcome any feedback. Thanks

admay 2017-12-08T20:58:55.000039Z

So you’re thinking of a library to allow developers to tell a story via code showing users how to user said library?

seancorfield 2017-12-08T21:19:16.000359Z

@drewverlee Have you looked at Marginalia?

seancorfield 2017-12-08T21:21:37.000076Z

I've been using that heavily on a new project I started at work recently and really liked it. I wrote the narrative (as markdown in comments) for the code and then gradually filled in code in among that narrative, turning some narrative comments into docstrings as I wrote the functions (and leaving other parts as comments, since Marginalia incorporates those into the documentation).

2017-12-08T22:03:14.000509Z

I think this concept could be used for both helping with the development story and with the user story. They would probably be different narratives

2017-12-08T22:04:23.000206Z

I look a very brief look at it, I plan on studying it more as the goal is the same.

admay 2017-12-08T22:43:39.000338Z

I think both help to build on the other. I like the idea though. If this is a practice that developers can adapt as part of their early workflow, telling a story of their code, then not only will documentation come more easily and more clearly, but, like you said, so will development. It’s also a great tool for the developers because lacking or poorly formed APIs will show themselves earlier on

dottedmag 2017-12-08T23:00:30.000231Z

Looks very similar to literate programming.

dottedmag 2017-12-08T23:00:48.000236Z

Is there a difference I failed to grasp?

seancorfield 2017-12-08T23:05:01.000160Z

Literate programming is documentation with code embedded and has machinery to reorder/reassemble code -- so narrative takes precedence. Marginalia is very lightweight by comparison and is focused on code that contains documentation, rather than the other way around.

seancorfield 2017-12-08T23:07:43.000222Z

What you're describing in narrative (above) seems very much in line with what Marginalia achieves: annotated code that can produce nice documentation, with code fragments aligned with the relevant pieces of documentation, while also not affecting the code (and not needing any special editor plugins etc).

dottedmag 2017-12-08T23:08:13.000217Z

@seancorfield @dottedmag != @drewverlee 🙂

seancorfield 2017-12-08T23:08:16.000018Z

At most you might want comment-line-folding to reduce the "noise" if you get carried away with inline comments and marginalia.

dottedmag 2017-12-08T23:09:02.000232Z

Actually, I was referring to @drewverlee’s narrative idea when asked about lit. prog.

seancorfield 2017-12-08T23:10:48.000230Z

Yes, @drewverlee replied in a thread saying narrative's goal was the same as Marginalia -- so my response was to you @dottedmag drawing a distinction between literate programming and what Marginalia provides which is what @drewverlee said was the goal of narrative 🙂

seancorfield 2017-12-08T23:12:01.000128Z

So narrative/Marginalia are different to literate programming.

dottedmag 2017-12-08T23:12:19.000164Z

I see, thanks.

seancorfield 2017-12-08T23:12:33.000047Z

I could have been clearer about it 🙂

arrdem 2017-12-08T23:12:41.000091Z

https://github.com/arrdem/stacks

arrdem 2017-12-08T23:13:16.000190Z

I personally subscribe more to the narrative style - for my last big project I wound up writing a bunch of documents (design doc, runbook, architecture overviews) all of which I wanted to cross-link and relate to the code.

arrdem 2017-12-08T23:14:03.000375Z

I think that supporting separate documents mutually referencing docstrings & symbols is far more important than inline commenting. Been playing with some ideas about how to build a sphinx-like that supports that workflow well for Clojure.

arrdem 2017-12-08T23:14:27.000246Z

(not much in that repo so far, just some doodles at parsing example files for analysis & highlighting)

seancorfield 2017-12-08T23:15:44.000010Z

Stacks sounds like it has a lot more in common with Literate Programming, since it's primarily documentation that you might extract code from?

2017-12-08T23:19:49.000171Z

I'm gathering feedback at this point mainly. I feel like everyone wants interactive, informative docs, so the idea isn't probably novel. Its probably just not worth the cost... But maybe there is some way to help developers incrementally build that up as it becomes more valuable.

seancorfield 2017-12-08T23:46:58.000145Z

Yeah, there's definitely plenty of room for ways to help developers produce better documentation. I've always been very leery of Literate Programming in the large but most of the API Documentation generators are too minimal for the sort of internal documentation I'm interested in...

arrdem 2017-12-08T23:47:24.000009Z

Stacks is gonna have a fairly strict docs vs code separation. It’ll consume docstrings as one source but my expectation is that the majority of documentation will be written separately.

arrdem 2017-12-08T23:48:07.000107Z

And that making writing that documentation and linking to the extracted source information is what you should optimize for.