Drasil
Drasil copied to clipboard
Extra Spaces Added after references in generated Jupyter Notebook
When adding references in the Organization of Document section for #3318, the Jupyter Notebook generated adds extra spaces between the punctuations and the references.
Is it ok to have the spaces, or should it be fixed?
The discussion where it was first identified can be found here @smiths @samm82
In a previous version of this implementation (without the Oxford comma), I noticed that there was an extra space before the "and" (e.g., item and
instead of item and
); the issue seems to be with an extra space added after the references instead of being inserted before the punctuation. It doesn't look like the double space shows up when rendering the Jupyter notebook, but it should still be fixed to be correct.
@harmanpreet-sagar, thank you for creating this issue. Yes, we definitely should look into this and generate the Jupyter notebook without the extra spaces.
Question: I cannot find the generated code file's position, can you tell me which of the file is changing the jupyterhub notebook? @samm82
@samm82 I did not find where the error is.
I try to open the generated code and file, however, the space before and
is all single space.
Also, the given image cannot be opened, can you give these images again?
Sorry for the delay on this! This issue can be found on the following line:
https://github.com/JacquesCarette/Drasil/blob/d5afe5c61d5fac443a5eac96fef5856bf07454e8/code/stable/projectile/SRS/JSON/Projectile_SRS.ipynb#L174
My guess is that this issue occurs throughout all generated Jupyter notebook files whenever a list of references is encountered (although it may also occur with any list of items; this would be something to look into).
I see some of them have this problem, these are places with this issue:
Three examples have this issue: GlassBR, PD controller, and SSP
@samm82 For all these three examples, we need to change the Section 4.2 code parts. However, the corresponding section says it is automatically generated: (As you can see on section 4.2.4)
Looks like there is nothing we can change. If there is a section elsewhere (which determine that), where is it?
You're right that the issue is with the code that determines how this is generated. I'm not sure where that code would be; figuring that out is part of this issue! 😅
My guess is that this is an issue with how lists of references are rendered when generated code and not specific to the Data Definitions section. Don't know where that happens off the top of my head, but hopefully that points you in the right direction!
@samm82 I suspect the contents of function "Comma" has some problems, so there is an extra space added after each references.
however, remember this problem only occurs at the Jupyterhub notebook. I wonder how we generate the notebook files, where is the code transferable text to Jupyterhub notebook (unique code for on Jupyterhub notebook rendering).
Up to now, the code of printing reference texts is already found, but this text does not have any problems (Otherwise Latex and Html SRS documentations will have the mentioned extra space too)