tact icon indicating copy to clipboard operation
tact copied to clipboard

Generate stdlib refence in Tact docs from doc comments in stdlib

Open anton-trunov opened this issue 8 months ago • 8 comments
trafficstars

anton-trunov avatar Mar 04 '25 10:03 anton-trunov

Blocked by #2236

i582 avatar Mar 04 '25 10:03 i582

No, this way we lose information: math, links, aside notes useful and available only in docs, etc. I understand the sentiment for making code first, but our docs & stdlib relationship is not the case.

We must generate in other direction as discussed in older issues -- from docs to doc comments. At least in stdlib, for user documentation tact doc we can go other way around.

novusnota avatar Mar 04 '25 10:03 novusnota

How would we lose it? We will just copy the doc comments to their corresponding sections in the docs, the stdlib reference would be automatically generated, all math and links preserved.

anton-trunov avatar Mar 04 '25 10:03 anton-trunov

It's the job of the Tact book to provide examples and give more context on how to use the stdlib functions, not the job of the reference

anton-trunov avatar Mar 04 '25 10:03 anton-trunov

Oh, you mean code examples only? This issue title states that the Reference section will be generated from the doc comment in stdlib. Doc comments in stdlib do not preserve [](), [][], $$ and other things when ported from the docs.

novusnota avatar Mar 04 '25 10:03 novusnota

Basically, the stdlib reference should be the exact copy of the Tact files from stdlib (without the function implementations). Also, we could even include the implementations provided those are folded by default and there is a CI check the sources and their mdx/html renders are in sync

anton-trunov avatar Mar 04 '25 10:03 anton-trunov

Basically, the stdlib reference should be the exact copy of the Tact files from stdlib (without the function implementations). Also, we could even include the implementations provided those are folded by default and there is a CI check the sources and their mdx/html renders are in sync

Once again, those doc comments have already lost a bunch of info within them. Visual and otherwise.

It's like going from a dehydrated format to a feature rich format and expect the latter to magically contain expressive things :)

UPD: With #2743 in mind this is doable.

novusnota avatar Mar 04 '25 10:03 novusnota