visual-scala-reference icon indicating copy to clipboard operation
visual-scala-reference copied to clipboard

"See also" that guides users to related functions

Open exoego opened this issue 5 years ago • 1 comments

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

  • compose and andThen in Function
  • drop | dropRight | dropWhile | take | takeRight | takeWhile in Collection
  • head | headOption | last | lastOption in Collection
  • ...

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 ?

exoego avatar Jul 04 '19 07:07 exoego

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.

superruzafa avatar Jul 04 '19 11:07 superruzafa