superruzafa / visual-scala-reference

Visual Scala Reference
https://superruzafa.github.io/visual-scala-reference
269 stars 28 forks source link

"See also" that guides users to related functions #4

Open exoego opened 5 years ago

exoego commented 5 years ago

There are some comibinations of functions that are related to each other, e.g.

I think adding a see-also table or something to each page would be helpful for readers, so that they can find related functions even if they don't know names of all functions.

Such goal could be realized by mentioning related function in page. But I think it could be error-prone and tedious... especially when accounting translation into. So it would be nicer if relations between functions are generated by Jekyl for all pages in all translations, in single source of truth, like see-also.yml or something like that.

see-also:
  group1: [compose,andThen]
  group2: [drop,dropRight,dropWhile,take,takeRight,takeWhile]
  group3: [head,headOption,last,lastOption]
  ...

I don't know Jekyll much... it may have such feature ?

superruzafa commented 5 years ago

Yes, I already though about that. Since these relationships are language-agnostic it should be placed somewhere outside the .md translated files. Also, I think it should be a short list because almost every function could be related with the rest of them in one way or another.

The idea is to have something like this:

head:
    last is the right-to-left case
    tail is the opposite
    headOption is the safe way

In addition, it should be easy to work with that relationships for translators.