Skip to content

Commit

Permalink
feat: add button to export the rst document as PDF
Browse files Browse the repository at this point in the history
Add button to export the rst document as PDF.
As requested here, anru#28 .
Most of the code was already there, I refactored and did small changes.
Give the `textarea` the `form` attibute to attach it to the form id
`save_as_pdf`.
  • Loading branch information
anshulxyz committed Aug 19, 2017
1 parent 470c9c2 commit 7750caf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,25 @@
{% block content %}
<div class="b_page_cont">
<div class="b_page_left">
<textarea id="editor" rows="15">{{ rst }}</textarea>
<textarea id="editor" rows="15" name="text" form="save_as_pdf">{{ rst }}</textarea>
</div>
<div class="b_page_right">
<div class="right_nav">
<div class="themes left" id="themes">Theme:
<input id="t_basic" type="radio" value="basic" checked="checked" name="style"/><label for="t_basic">Basic</label>
<input id="t_nature" type="radio" value="nature" name="style"/><label for="t_nature">Nature</label>
</div>
</div>
<div class="right">
<form id="save_as_pdf" method="POST" action="{{ request.script_root }}/srv/rst2pdf/">
<input type="submit" id="as_pdf_rst" name="rst" value="Export to PDF"/>
<input type="hidden" id="as_pdf_theme" name="theme"/>
</form>
</div>
<iframe src="{{ request.script_root }}/srv/rst2html/" id="browse"></iframe>
</div>
</div>

</div>

<form id="save_as_pdf" method="POST" action="{{ request.script_root }}/srv/rst2pdf/">
<input type="hidden" id="as_pdf_rst" name="rst" />
<input type="hidden" id="as_pdf_theme" name="theme"/>
</form>

{% endblock %}

0 comments on commit 7750caf

Please sign in to comment.