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

Weird documentation rendering after updating to tfv2 #218

Open
brollb opened this issue Oct 28, 2020 · 4 comments
Open

Weird documentation rendering after updating to tfv2 #218

brollb opened this issue Oct 28, 2020 · 4 comments
Assignees

Comments

@brollb
Copy link
Contributor

brollb commented Oct 28, 2020

It looks like some of the formatting of the docstrings in tf v2 don't quite match the formats used in keras which results in ugly rendering:

DeepinScreenshot_select-area_20201028143327

@umesh-timalsina
Copy link
Contributor

umesh-timalsina commented Oct 29, 2020

Does this take care of the examples field in docstring Example fields like these?

ShowHelpDocs.convertDocsToHtml = function(docs) {
// First preprocess the docstring to (nice) markdown
docs = docs
.replace(/^\s*/mg, '') // default indentation creates code blocks
// Convert the arguments to a list
.replace(/^([a-zA-Z_]+):/mg, (match, argName) => `- ${argName}:`);
return mdConverter.makeHtml(docs);
};

@brollb
Copy link
Contributor Author

brollb commented Oct 29, 2020

ah, good catch. I don't think so. It might be good to try to detect the headers. They seem to follow a standard convention of a line with just the header and a colon...

I am not sold that this is the best approach but parsing docstrings is harry business...

@umesh-timalsina
Copy link
Contributor

For now, we decided to remove examples from the docstring from the rendered markdown. Later on, we can investigate more on how to render the example visually rather than as python code that the user needs to convert to a layer again.

@umesh-timalsina umesh-timalsina self-assigned this Oct 29, 2020
@brollb
Copy link
Contributor Author

brollb commented Nov 10, 2020

There is also an issue with the graph nn layers (from spektral) as they could really use mathjax or something similar to render the equations:
DeepinScreenshot_select-area_20201110125223

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

No branches or pull requests

2 participants