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

Add expand rust macro button #1343

Closed
wants to merge 1 commit into from
Closed

Conversation

sigmaSd
Copy link

@sigmaSd sigmaSd commented Sep 29, 2020

context: Veykril/tlborm#16

If this is an accepted feature, I'll try to figure out if I can add syntax highlighting to the result.

@sigmaSd
Copy link
Author

sigmaSd commented Sep 29, 2020

For highlighting , using this code on the console:

Array
            .from(document.querySelectorAll('code:not(.editable)'))
            .forEach(function (block) { hljs.highlightBlock(block); });

The highlighting is incorrect, it greys out most of the code (image truncuated)
broken_highlight

@ehuss
Copy link
Contributor

ehuss commented Sep 30, 2020

I don't think this is something we can do using the playground, as we can't use arbitrary endpoints in their API.

I might suggest putting the examples in separate rust files, using rustdoc_include to embed them in the book, have a separate script which will run cargo expand on the examples, and use javascript/css to provide some kind of "expand" button to show those expanded results.

@sigmaSd
Copy link
Author

sigmaSd commented Sep 30, 2020

Understandable, thanks for the suggestion I'll ping the author about it.

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

Successfully merging this pull request may close these issues.

2 participants