-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/journal pdf endpoint #280
Conversation
This reverts commit 1afcfa9.
Addresses: NASA-IMPACT/nasa-apt-frontend#162 |
Database fields for journal details section
@leothomas pushed a commit to this branch adding another ATBD fixture with more data. Also tested the pdf and only the normal one is working. What I did
Errors with:
For the other ATBD, not even the normal PDF works. OtherWhile adding the other ATBD fixtures I was confronted again with the image problem on local development: |
It's actually the macro One solution is to specifically watch out for this macro and try to escape it somehow. I'm concerned that this part of a larger problem due to the huge variety of possible user inputs, we will always be running into these kinds of errors |
@danielfdsilva I've fixed the As for the local development image problem, I spent a good deal of time banging my head against this today. I've understood the root of the problem and I've reached out to more experienced team members for help finding a solution (I've tried everything I found on StackOverflow without success). The root of the problem is: This is why when the filename is stored under Off the top of my head, the solution would be one of the following (in increasing order of hackyness):
The good thing about this issue is that it only affects developer experience (since the pdf generation script has no problem loading files from external domains), however it's pretty important to be able to generate PDFs using local data, for testing and dev purpose. I'll keep plugging away at this tomorrow. |
After a super helpful chat with @CiaranEvans , I tried wrapping the front end in a docker instance that can also connect to the network of the backend containers, which allowed the frontend container to download the file, however it still wouldn't load in the browser since the frontend container exposes a port to the browser and the browser attempts to the load the image. I resorted to implemented a hot-replacement of the string Front end PR is open here |
…d `split` environment in equations
Equation Wrapping:Intelligent/graceful equation wrapping is very hard to achieve programmatically. In fact there's only one LaTeX package that attempts it (breqn) and reviews say it's still very experimental and not very stable.
produces the following equation Note:(The equation's LaTeX code above does overflow the WYSIWYG editor in the frontend app, which distorts the shape of the overall editor, that might be something to address) (as opposed to: @danielfdsilva As long as we have documentation on how to use If so, the all the requirements for the journal PDF can be considered complete. |
@leothomas Equation wrapping looks great and I'd say leaving this up to the user is ok. IssuesThere are a couple of problems with the tables: Is being rendered like so in both pdfs
|
35bd642
to
58e7ca3
Compare
What I did:
Implemented a journal "flavour" pdf creation. The journal flavour:
Discussion
andAcknowledgements
sectionsI modified the following in both the journal and the regular "flavours" of pdf:
Algorithm input variables
andAlgorithm output variables
now handle input as a WYSIWYG element (as opposed to a text element)"caption"
item is present in the table's WYSIWIG element)ref
property)Whereas the regular pdf generation can be triggered at the endpoint
/atbds/alias/{atbd-alias}.pdf
, journal "flavour" pdfs can be generated by requesting the following URL:/atbds/journal/alias/{atbd-alias}.pdf
How I did it:
Most changes are contained with
serialize.py
. I added a table (with overflowing cell content), additional algorithm input variables and references to thetestData.sql
file for local development/testing purposes.How you can test it:
Spin up a local instance of the backend server using;
./startServer.sh
and point your url tohttp://localhost:8000/atbds/journal/alias/test-atbd-1.pdf
. A journal flavour pdf should be generated.Note:
The features in this PR are ready to be tested. The following things need to be addressed before the issue can be considered complete:
ATBD examples: