Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use backticks to emphasize names #5

Open
ghostsquad opened this issue Jul 15, 2020 · 8 comments
Open

feat: use backticks to emphasize names #5

ghostsquad opened this issue Jul 15, 2020 · 8 comments

Comments

@ghostsquad
Copy link

current:

fn container.array

### fn container.array

suggested:

fn container.array

### fn `container.array`
@ghostsquad ghostsquad changed the title use backticks to emphasize field names feat: use backticks to emphasize field names Jul 15, 2020
@ghostsquad ghostsquad changed the title feat: use backticks to emphasize field names feat: use backticks to emphasize names Jul 15, 2020
@sh0rez
Copy link
Member

sh0rez commented Jul 15, 2020

This project generates Markdown – so the whole Markdown syntax set is available ;)

@ghostsquad
Copy link
Author

Yep! I wanted to file an issue to see what you thought of the suggestion. Happy to submit a PR if you agree

@sh0rez
Copy link
Member

sh0rez commented Jul 16, 2020

Oh right, this is about the generated part, not the one taken from Jsonnet. Misunderstood while reading on mobile.

After all, I tried to mimic what godoc does, and it does not use <code> there. If this is for a reason, I don't know. Personally, I like the current style, also because monospaced fonts tend to steal more focus from the eye than needed here.

I'd rather suggest making them <a> links, which also highlights them in color and makes it easier to link to html sections. WDYT?

@ghostsquad
Copy link
Author

Color would be great! What would it link to?

@ghostsquad
Copy link
Author

It GoDoc, it links back to the source code. And although I would love that, I think it wouldn't totally make sense here, unless the user specified the URL (relative) to use due to the lazy evaluation of jsonnet.

Likely though, that's going to be hard to maintain for users.

@sh0rez
Copy link
Member

sh0rez commented Jul 16, 2020

For starters, it could link to the respective html permalink, even though source code would be super awesome

@ghostsquad
Copy link
Author

std.thisFile returns the full path to jsonnet file being evaluated.

❯ jsonnet ~/tmp/test.jsonnet
{
   "filename": "/Users/wmcnamee/tmp/test.jsonnet"
}

Some light testing indicates that you cannot do this for the user though (e.g. put std.thisFile within a function, and somehow find the callers file).

@ghostsquad
Copy link
Author

you might be able to do some magic with though if the user provided the library with the filename.

d.fn(filename=std.thisFile)

then work out where the root of the repo is, and strip out everything lower than the repo root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants