Create Django sphinx single page html? - django

I created sphinx html using command make html.But i need a single page document with heading and content.When i click a particular heading page should automatically scroll down to that corresponding content.

I think you want singlehtml instead of html. See the sphinx docs for all the build options.
make singlehtml

Related

How to turn a Django webpage into a PDF

I would like to add a feature to my Django website where the user can click on a link saying "Save as PDF". I would like this link to 1) produce a slightly different version of the page the user is currently on and 2) generate a PDF file in a separate window that the user can then save to wherever he or she wants.
All of the PDF functions I came across related to Django assumed that you already had a PDF that you wanted to render. In this case though, I want to create a PDF based on the content of the current page. Any idea how to do this? Thank you.
You can try this tool WeasyPrint. You can use it with Django
Any webpage is just a HTML basically so any html to pdf library would work. But this one is specifically built for django. Hope this helps.
Documentation for django-wkhtmltopdf

Drupal 8: How to alter the final html output?

I use a single drupal8 installation to serve content for multiple website's FAQ section. So I have put some custom tags like "##website_name##" in the html in article content and title. I also have blocks and custom views which display links to other articles like: related articles or popular articles etc.
I want to replace the custom tags with the respective value of the website. Is there any hook present in drupal8 which will be executed on generation of final output html but before sending it to browser so that I can place my replacement login there ?

Reload googlemaps after user clicks a link in Django

I am doing a project in Django and i want to have some google maps displayed in my site. So, i installed django-easy-maps and successfully used it in a sample template. So, i am ready with my maps.
The interface i want to implement is this
http://i49.tinypic.com/sowm74.png
I want to display the maps where the Hellow World! container is and with different links on the sidebar i want to refresh the map being displayed on user click without reloading the page.
I did some researching and it seems Ajax is the solution...
Can anybody tell me how i might achieve this (with or without Ajax ) ?
Sorry for sounding like a noob but i am fairly new to this.
The basic steps are:
Create a view for the Google Maps section to the right. This view does not return a full HTML page but only the HTML for that section (which contains your Google Maps map).
When the user clicks on a link on the left, use JavaScript to perform an ajax call to request that page. In short this means: attach an event handler to the onclick event of those links and in code you can perform an ajax call .Many people use a JavaScript library for this purpose, such as jQuery (which has $.ajax()).
You can then use JavaScript to put the received HTML inside the container on the right (using $.html()).

How can I create a searchable attribute for a page on Confluence wiki?

I want to create a page in my confluence wiki which has a searchable attribute. Right now search is limited to the pages text, and then filtering using tags. It would be great if I could filter further based on defined page attributes.
The easiest way is to just add specific labels to that page .. e.g. "info1" and "info2". Afterwards you're able to search for that page using the normal Confluence search and searching for labelText:info1 and labelText:info2.
Another choice is using a combination of the Metadata Plugin and the Reporting Plugin together - they are both available for free at Atlassian's Plugin Exchange.
You can use a SQL query to search the Confluence storage format (XML source) of your pages.

Use django text plugin for model fields in custom plugin

Hi this is a long shot i think but here goes.....
Basically i have a few custom plugins and apps being used in my django /django-cms site. I have set tinymce up which is working fairly ok however what im wondering is it possible to use the built in text plugin for the TextField model fields in my custom plugins and apps?
so in effect the info text field for my main content plugin would actually render in the admin site as the text plugin
Like i said i think this is a long shot...
You cannot use single-plugins on models, however you can define PlaceholderFields on your custom models to put cms plugins in. So you can define a PlaceholderField, put a TextPlugin inside that placeholder and do whatever you want.
For more information, read the official documentation about this http://docs.django-cms.org/en/2.1.3/extending_cms/placeholders.html
I also had this requirement (formatted text on a django-cms plugin configuration) and ended up with the following workaround:
I installed django-tinymce and changed my TextField to an HTMLField in the CMS plugin configuration model. This will render a tinymce text editor in the plugin configuration form. You can then use the input from the HTMLField in your plugin template with the ...|safe filter.