Get HTML Equivalent of Google Doc contents - google-apps

I am trying to get the HTML for a Google Doc's contents. The methods I have found all seem to use deprecated items. I ultimately want to use the Doc as a template for an email. I have everything working except getting the HTML version of the text. Yes, I want the full HTML version including tables, images, and anything else I can place in the Doc.
Is there any way to get this?
Regards,
Karl S

I believe the following method works:
Open up the Google Doc you want to work with
Click File-->Publish to the web
Click Link and then Publish
Copy the link into another tab
View the source for the page and copy everything inside and including <div id="contents">
This should be the complete HTML for that document. I just verified that it works with a document of mine. Let me know if it doesn't.

Related

coldfusion show pdf on page

I know coldfusion has extensive pdf support, but I'm not sure if this is possible.
I was given a pdf form and told to make it so it is both filled out online, the data is captured, and the form can be printed.
Obviously, I can create an html page that looks like the document, save everything, generate the filled pdf form, etc.
Alternately, I think I can show the pdf, have them fill it, then grab the form data. I'm not entirely sure I can do this though, because I would need to detect when they are done filling it out.
But I was thinking it would be nice if I could do it this way - Show the pdf embedded on the webpage, let them fill it out and print it, then capture everything when they are done. I was looking through the CF documentation (cfpdf cfhttp, etc), but not finding exactly what I need. Is this an option?
You can extract the data from a PDF using the cfpdfform tag or as an HTTP Post. Here's a link to the docs on how to do that, but it depends on how you set up the PDF itself. You can edit your PDF form to actually submit just the formdata to a given CF page. It arrives on the page in a struct tied to the form name (ie. #form.form1.Fields.blah# etc.). Dump it out to deipher it (it's kind of convoluted) So you could fire print and submit from within the PDF.
The second way is to submit the PDF itself as a file. In this case you use the cfpdform tag - not well documented or widely used. Both approaches are covered lightly in the link above. Good luck!
We can show the pdf on page using cfheader and cfdocument tags. We can only show the pdf on webpage using the following example code.
<cfsavecontent name="pdfcontent">
//Here what you need to show the pdf
</cfsavecontent>
<cfheader name="Content-Disposition" value="filename=Mydocument.pdf">
<cfdocument format="pdf" orientation = "landscape" bookmark="Yes" marginleft=".25" marginright=".25" marginTop = ".25" marginbottom=".75" scale="90">
<cfoutput> #pdfcontent# </cfoutput>
</cfdocument>

Link to specific line in javascript source?

I have javascript source code served at http://www.example.com/static/script.js. I'm writing documentation and rather than including the code of certain functions I want to refer to, I'd just like to link to the source- but I would like to link to the specific line of the Function in the source document.
Is this possible, to create a link to a text document at a specific line without using html anchors or javascript window.scrollTo?
Never found a way to link to javascript source, but easy to do with GitHub - Just add "#L" + lineNo to the url. For instance: https://github.com/ArbolEric/RaphaGraph/blob/master/src.js#L210
Highlights and jumps to line.

How do I embed a single file from a GitHub gist with the new gist interface?

The new GitHub Gist interface has one embed snippet for the entire gist which embeds all files in the gist. The old interface had embed code for each file in the gist. Anyone know if there's a trick to embed a single file?
Take the gist URL from the left-hand side and after the .js add a query string like ?file=myFile.blah, e.g.
<script src="https://gist.github.com/4505639.js?file=macroBuild.scala" type="text/javascript"></script>
Medium
For those who want to use it on the medium, Medium does not support and does not query parameters in the URL when you add it after the paste of the URL. So just follow these 4 steps IN THE ORDER.
So:
⚠️ Order matters!
Copy the (multi-file) gist path. e.g.:
https://gist.github.com/MojtabaHs/91e34fd0e987fe7ce801936dc6ece0e8
Paste it somewhere else than the Medium article that not preserves the rich data of the text. Like an online textbox for example:
⚠️ Do not hit search or return button
Append the query param for the file to the URL. e.g:
https://gist.github.com/MojtabaHs/91e34fd0e987fe7ce801936dc6ece0e8?file=Interface.swift
Note that ?file=Interface.swift at the end of the URL, right?
Copy and paste it in the article and see the magic 🔮
An article using this method:
Implement Custom Activity Indicator With The SwiftUI
The MOST Important note that MUST be considered:
⚠️ Note that you MUST copy an unformatted plain text in the medium and MUST NOT edit the URL after pasting it in the Medium! You can copy the link in an online textbox like google.com and after appending the query, copy it back and paste it in the Medium.
GitHub provides this same information here on their site. As others have said the official way is to attach ?file=name-of-file.ext to the end of the embed code's URL in order to only embed the file called name-of-file.ext (you can of course change the name to whatever the name of your file is). For example, if I wanted to embed the getGitContents.js file from the Gist at https://gist.github.com/westc/afac9258389fdfd2fdaf134ffaa0e923 I can use the following:
<script src="https://gist.github.com/westc/afac9258389fdfd2fdaf134ffaa0e923.js?file=getGitContents.js"></script>
In addition there is this YourJS blog post about this which allows you to enter your user name and see the embed codes for all of your gists and the underlying individual files.
Just for other people reference that might be looking into this.
If you are using Wordpress you may achieve this with the plugin oEmbed-gist and shortcode style:
[gist id="your-gist-id-here" file="your-file-name.js"].

How to edit content more easily?

i add content to my confluence page like a html
inside {html} tags. This page will be changed in future every week. It very difficult to understand html so quick for people who never don't work with html.
Is there any way in confluence to add a simple user interface form which helps to edit information inside html?
I know that confluence have embedded jQuery can anybody give advice how to do it better?
Thanks
Use the scaffolding plugin to Show only some special text fields for editing. Then you can hide the HTML code. But scaffolding is not ready for Confluence 4
http://wiki.customware.net/repository/display/AtlassianPlugins/Scaffolding+Plugin
You could download the page with Atlassian CLI, and parse out the section of html you want to modify, put that in your wysiwyg, and then inject it back into the downloaded html and post it back.
Of course it is as fun as it sounds.
An example of the content would help to answer this question.
One option is to put your content in a word .doc file, save it, upload it to the page. Use the office connector macro to display the content of the .doc on the page. The office connector plugin is free.
Note that Confluence V5 editor now has a basic set of editing features found in Microsoft Word.

How can I simply add a downloadable PDF file to my page?

I want to add a pdf and word format of my resume to my portfolio page and make it downloadable. Does anyone have some simple script?
Add a link to the file and let the browser handle the download.
You may be over-complicating the problem. It's possible to use a href pointing to the location of the .pdf or .doc file, when a user clicks on this in their browser, generally they will be asked if they would like to save or open the file, depending on their OS/configuration.
If this is still confusing, leave a comment and I'll explain anything you don't get.
Create the PDF. Upload it. Add a link.
Save yourself 30 minutes tossing around with PDFGEN code.
You will want to issue or employ the Content-Disposition HTTP header to force the download otherwise some browsers may recognize the common file extensions and try to automatically open the file contents. It will feel more professional if the link actually downloads the file instead of launching an app - important for a resume I think.
Content-Disposition must be generated within the page from the server side as far as I know.
Option:
Upload your resume to Google Docs.
Add a link to the file on your portfolio page just as I do in the menu of my blog:
Use Google Docs Viewer passing to it the URL of the PDF as you can see in this link.