#New line in doc comment

1 messages · Page 1 of 1 (latest)

hollow pelican
#

Is it possible to enforce a new line in a doc comment?

eg.

/// Performs a matrix multiplication.
/// dim(A) := i x j
/// dim(B) := j x k
pub fn mul(A: Matrix, B: Matrix) Matrix 

But when I hover over the function in VSCode I get it all concatenated into a single line making it less visually clear.

If it's not possible to enforce a new line, what would you recommend as a seperator to make these statements visually distinct?

errant birch
#

what do you mean, do you want whitespace between the function and the doc comment?

hollow pelican
#

I'd like to add \n to the end of each line so there's a line break

#

right now it looks like this

errant birch
#

ah you mean doc generation

hollow pelican
#

taking your earlier suggestion to try anytype with good docs

errant birch
#

I think the zig doc generator right now isn't that good

#

also from typography point of view, this is pretty difficult to read

hollow pelican
#

do you mean the comment I used as an example, or the linked docs

errant birch
#

linked docs

hollow pelican
#

I was able to get a newline by having a blank line in between

/// Performs a matrix multiplication.
///
/// dim(A) := i x j
///
/// dim(B) := j x k
#

not the worst since latex is like that as well for new paragraphs

#

(also yes will need to fix types and stuff)

errant birch
#

Kinda ugly still :(

hollow pelican
#

yeah but it'll do for now haha

#

being able to show the equation for BLAS routines on a new line will be usable

rose kayak
#

Isn't it markdown? can you just add four spaces in front of each code line (and a blank line abouve them). I thought I read somewhere it was markdown. I'm probably wrong

#
/// blah blah
///
///    a = b
///    c = d
hollow pelican
#

that's looking a lot nicer

#
/// Performs a matrix multiplication.
///
///     dim(A) := i x j
///     dim(B) := j x k
#

at a glance it seems to be using the syntax highlighting for the language

#

will try putting a code example in it

#

not a full example but to get the gist

#

so not too bad

#

it's slightly off in highlighting std.heap as it doesn't recognise that std is imported but yeah

#

that same code put into a test