tpolecat / tut

doc/tutorial generator for scala
MIT License
581 stars 63 forks source link

Some new feature ideas #70

Open ghost opened 8 years ago

ghost commented 8 years ago

Not an issue, just some ideas that I have across, mostly not pure tut, but related to.

Some of these are easily added via jekyll modules but ghpages does not support all modules. So either the site would have to be pre-processed, the functionality replaced in tut, or just not done.

Or use pandoc.

Tex support

This is trivial using mathjax, see the cats layout.

Add knowledge metadata

Add some yaml lists to the start of the markdown, as for example here in https://github.com/non/cats/issues/403 (who spotted that the tags were yaml Lists?). "Recaps" might be better than "Repeats".

As another example, this scalaz document on the fourth line "As a prerequisite, I assume knowledge of type classes as they are implemented and used in Scala."

Adding a "Requires" tags just helps to in the document management.

Add Link management via citation management

There are jekyll plugins for bibtex, and pandoc has this. So rather than link directly, go via URL citations in the CM file/page. This can also be coupled with the previous idea to see that links are not introduced to concepts not marked as Requires or Recaps

ghost commented 8 years ago

I mentioned another topic in cats gitter ages ago, so I'll repeat it here as an idea, not a requirement.

Background:

As described in the owl primer, owl has several syntax that can be used and the primer allows the reader to pick the syntaxes to display - see the buttons here. So picking Functional, Turtle and Manchester, Advanced Use of Datatypes looks like

....we define a new datatype for a person's age by constraining the datatype integer to values between (inclusively) 0 and 150.

Functional-Style Syntax
 DatatypeDefinition(
   :personAge
   DatatypeRestriction( xsd:integer           
     xsd:minInclusive "0"^^xsd:integer
     xsd:maxInclusive "150"^^xsd:integer
   )
 ) 

Turtle Syntax
 :personAge  owl:equivalentClass
  [ rdf:type  rdfs:Datatype;
    owl:onDatatype  xsd:integer;
    owl:withRestrictions (
       [ xsd:minInclusive  "0"^^xsd:integer ]
       [ xsd:maxInclusive  "150"^^xsd:integer ] 
    )
  ] .

Manchester Syntax
 Datatype: personAge
   EquivalentTo: integer[<= 0 , >= 150]

(quick aside: compare the Manchester syntax with refined Int @@ Interval[_0, _150] )

Idea

I wonder if tutorials could have a similar feature, but rather than pure syntax, perhaps something like... (taken in the main from Bijection and cats tuts):

The motivation is that very new users users can add/remove notations as their knowledge grows

tpolecat commented 8 years ago

Yeah @non and I were chatting (see #69) about expanding tut to encompass a more general idea of literate programming, and exploiting the Jekyll header is a reasonable way to inject new metadata without a lot of ceremony.

I'm skeptical of the OWL stuff because I worked at a company that did this stuff and became convinced that it's useless, but maybe you can convince me otherwise. It looks interesting.

So yeah let's fill this issue up with ideas and see what we can do. I'm looking to do a ground-up rewrite later this year so it will be good to have future directions in mind.

ghost commented 8 years ago

@tpolecat I'm not surprised that you were involved in owl, nor your assessment - but it's just an example,

At least I didn't mention Dita ;)