How to import a page break from html to google docs? - google-docs

I'm trying to export a document in html and import it again (for the purpose of the test I don't even edit the file). After exporting, I can see that the page break is kept in the html :
<hr style="page-break-before:always;display:none;">
But after I import this file into google docs, and do the conversion, the page break is not materialized in the document. I can only see a line where the pagebreak should be.
Is there is a way to make it working ?
PS: I'm using the python gdata v3 API.

I've also been looking for this. It seems this is as easy as adding:
<hr class="pb">
Credit: https://productforums.google.com/forum/#!topic/docs/fqLmAJkPpTs

Related

Web based code editor with auto completion

guys
I'm building the web based code editor for my personal project.I want to make it work like VS code but facing some issues.
I'm using ACE editor.
This is what I get while trying with autocompletion.
I'm getting all the available suggestions while trying to write "os.(something)", rather then just getting the language and package specific suggestions.
What I want is this.
In this pic as you can see I'm getting suggetion related to os package only.
Depending on your setup with require-js, you may also need to include an additional javascript file in the html for your page. You need to write this simple script to working with the auto completion feature.
ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
enableBasicAutocompletion: true
});
Demo: https://github.com/ajaxorg/ace/blob/master/demo/autocompletion.html
Reference: https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor
HTML, JS, CSS Based
Create <textarea onkeyup=compile() id=code>. It should be big enaugt for code.
Create <script> </script>
Build the autocomplete
Script: function compile() { document.GetElementById('code').value = document.GetElementById('code').value.replaceAll('snippet1', 'Snippet1Value').replaceAll('snippet2', 'SnippetValue'). ...
E.g.: When you enter _text_ (and you set snippet1 to <input type=text>) then your textarea will write <input type=text>. To create an picker, use a contextmenu-library at json.
I know, this is only an plan how to do is.

Weasyprint output format issue - how to use CSS #page?

I used to use wkhmtltopdf to print some webpages but unfortunately it doesn't work anymore with some modern websites.
I found weasyprint which I tried in command line. The output has all the contents but text is cropped probably due to page size.
The website tells this is customizable in CSS (https://weasyprint.readthedocs.io/en/stable/tutorial.html#adjusting-document-dimensions). I'm not a web expert and don't really know what to do here. Should I copy and edit the source code of the webpage ? Where should it be inserted then ?
Here is sample webpage I'd like to print properly as a pdf:
https://korben.info/8-clients-alternatifs-pour-spotify.html
Has anyone succeeded in proper printing with weasyprint ?
Thank you for your help.
Adjusting Document Dimensions
Currently, WeasyPrint does not provide support for adjusting page size or document margins via command-line flags. This is best accomplished with the CSS #page at-rule. Consider the following example:
#page {
size: Letter; /* Change from the default size of A4 */
margin: 2.5cm; /* Set margin on each page */
}
#page is a CSS media query, so you have to write down the code in a .css file.
Once done you can call
weasyprint -s path/to/css/file input output
Notice that complex pages are usually bad rendered by weasyprint, as there are few not-supported style tags (calc, var, overflow on precise axis, ecc..).
Let me say that working like taht is a mess, if you need to do complex things consider to use weasyprint as a Python lib and not in standalone mode, so you can process sources and achieve better results in whatever you need to do.
Hope it helps.
Hele.

How to share html report of pytest-html with out changing the css

I am using python 3.6 and pytest-html to generate HTML reports .
Everything is successfully working but when i share my html report to my manager the css of the entire document is out of placed .can someone tell the reason to why it is happening and the solution for it .
The view of reports when i run:
The view of the reports when i share the document with my manager
include --self-contained-html when you are calling your pytest...such as
pytest your.pyfilename --html=pathandfilename --self-contained-html.
Your result file have inline css in it.
html=report.html --self-contained-html
It seems like you are not sharing whole bunch of items like CSS with html file you are giving. Just place the CSS code inside your HTML rather than giving the path and it will solve your problem.

ReactJS components for PDF export, Excel export and print

I´m building some ReactJS Table and Report components tha basically will contain <table> data, some graphics (d3) and some textual data. I need to provide 3 buttons:
Export to PDF
Export to Excel
Print
Are there any trustable packages available for the tasks above using ReactJS ? What is the approach to handle these requirements ?
I would use a combination of the following JavaScript libraries:
React Csv is my favourite JavaScript library for working with csv. It excels at dynamic generation.
PDF Make is my favourite JavaScript library for generating PDFs.
Note: I would attach the files to this post, but there is currently no facility for this in StackOverflow.
react-pdf (published 16 days ago - not tested)
react-export-excel (published 8 months ago - not tested)
For printing, put window.print() in your code
Example:
Copy and paste this as .html (in React, it would be onClick={window.print()} ... If I'm correct)
<!Doctype html>
<html>
<body>
<p>Use the button below to print</p>
<button id="print" onclick="window.print()">Print</button>
</body>
</html>
Old question, but since I was looking for something similar, I ended up using :
jspdf (see specific issue for reactjs)
react-excel-workbook
nothing yet, feel free to update the answer if you have.

How to add a post image in Ghost's index?

I don't see any examples in the docs on how to use a post's image on the index view of Ghost. For example, you can see this theme doing it: http://studio-lite-theme.ghostify.io/
Any ideas?
EDIT: If anyone comes across this, I found this post that helped: https://ghost.org/forum/themes/1401-tip-how-to-show-the-pic-of-your-post-in-index-hbs/
Since version 0.5.2 there's now official support for Post Images. So avoid the hack using {{content words="0"}}
Instead use {{image}} to print out the url for the image.
For example:
<header {{#if image}}" style="background-image: url({{image}}){{/if}}">
As #user3088077 mentioned in his edit, I could make the image appear in the index page by replacing in the index.hbs
from {{ excerpt }} to {{content words="0"}}.
What happens is that excerpt does not include images, while content does.
This is aimed towards displaying the featured image in index which means it needs to be on the front page not on post page.

Resources