Produce single page of HTML? - gitbook

Is there a way to have gitbook produce a single page of HTML from a document? I've seen smatterings of conversations about an older option in the Issues, but don't see any documentation about it with the current version.
Was this option removed? Any way to get it back?

Related

Saving history of usage to offer suggestions

I have a small extension that perform local search.
It searches for the files matching that name in the local company files list and then opens a page with the results.
The extension has a text box where users type in the query.
The problem is that if I click the extension again and want to do a query that I already did previously, I need to type it out again.
I want the textbox to save history, and show suggestions when I start typing a new query.
How can I do this? The suggestion matching can be a very simple string matching, nothing fancy. But how/where canI save the history?
If you are asking about standard browser's autocomplete then I don't think there is a way to programmatically create it.
You can build your own with jQuery's autocomplete plugin, for example. You will just feed it previous queries and it will do the rest.
To store previous queries you can use localStorage, which you would need to access from a background page.

Custom navigation with Liknlist web part

I'm using a standard link list web part. What I want to achieve is before my users click on the link a pop-up javascript warning box will display, stating that they are leaving the domain. In regular anchor tag I would preceed the URL with javascript:ShowWarning('http://www.youtube.com');.
I've search the AllLinks table in the database but did not find the links was looking for.
Where or how are these stored?
Thanks,
Risho
Firstly, editing the SharePoint database directly is a really bad idea. You shouldn't do it unless you really, really know what you are doing, and even then you will probably break the system.
Secondly, any change made in the data will be what shows up in the editor, and I don't think the editor supports links that don't start with "http://".
A better approach is to use jquery to add the popup behaviour to the links when the page is loaded.

target form to specific browser tab

Is there a cross-browser compatible way to post a form in one tab of the browser to another (which I know is open and is of the same domain)?
I tried window.name='some_name'; and target='some_name' on the form, but this does not seem to work. Am I missing something?
There is no standard to how tabs are handled via javascript, so you are out of luck.
Most browsers these day also make sure each tab is segregated/partitioned from others, as much as possible, so this is unlikely to change in the recent future.
The closest you can get to posting to a different page is to use AJAX, or possibly using frames.

Displaying code snippets in Sharepoint wiki

Is there a way to get SharePoint to display code snippets in a pre-formatted way?
Currently if you insert any code, it just looks exactly like the rest of the text. Anything would be better than nothing.
I found hilite.me which produces html styled code which you can insert into a sharpoint wiki.
It supports a number of languages and styles and is an online app.
No because MOSS's wiki is just a new page with the word "wiki" attached to the link.
Even though this is an old question, I have yet another solution that possibly didn't exist at the time the question was asked:
You can create a GitHub Gist and use the embed code for the Gist on the SharePoint wiki page. This is especially useful if you are already using Gist, want to share the code snippet in multiple places aside from the wiki, and/or want to keep a history of the code snippet separate from the rest of the wiki page.
To use an embed code without the script tags being stripped, go to Insert > Embed Code in the ribbon when editing the page:
This solution assumes that you are using an IDE that already formats the code for you.
Some of the other answers would be better if you have a raw text file.
While editing a Sharepoint Wiki page:
Copy code from IDE to new MS Word doc
Highlight all in MS Word: Ctrl+A
Copy again inside MS Word
Switch to wiki page, Paste
Continue editing wiki or save
Works fine with Eclipse as IDE. Might be able to paste straight from VS to SharePoint.
If you have code snippets you will reuse in multiple pages, Use a similar copy/paste technique to save or upload htm files into a SharePoint document library and then insert a "Page Viewer Web Part" to view the htm inside a different page.
Not that I'm aware of if you're specifically using the Wiki feature. Your wiki entries are stored like rows in a table as far as I know. If you're not using the wiki you can use the syntax highlighter tool. It's all javascript. http://code.google.com/p/syntaxhighlighter/
For several weeks we are using Telerik Rad Editor
One of the tools is "Format Code Block"
You may see it here : http://demos.telerik.com/aspnet-ajax/Editor/Examples/Default/DefaultCS.aspx
If you install the RadEditor for MOSS .. we will get this amazing tool in Wiki pages too.
So this is not a great answer but for us it was better then the default. You can write your wiki in a tool like Windows Live writer (WLW). WLW has an add in for a code formatter. If you write your wiki page via WLW with the code formatter you can then go to the Wiki page and select "edit HTML source." You can then copy from WLW to the wiki page and get good styling.
Best way I have found is to use tohtml.com
You can cut and paste your code into it and it will generate html that you can past into your sharepoint wiki
you can use prisimjs to show code snippets. When you add prisimjs and css you can use like this;
p { color: red }
if you want easier solution to use prisimjs, you can check this:
http://yasingokhanyuksel.blogspot.com.tr/2017/07/sharepoint-code-syntax-highlighting.html
If you want this for modern pages, there is the Source code content webpart from Qualitem.
https://spfxhub.com/packages/qualitem-source-code-content-web-part
Disclaimer: I am a co-developer.

Can you do complex editing of Word Documents in a browser?

A friend of mine wants to have an application where people can upload documents in Word (or text) format, and then allow people to make edits to those documents within a browser.
Is there any mechanism that would support adding text "bubbles" for adding comments? Either floating, or off to the side.
Being able to save back to Word format is a must too. Or at least, some format supported by Word, that would still be editable. Saving it as an image is not acceptable.
I was thinking about opening the Word Document in an FCK Editor window, but FCK only seems to have "normal" inline text editing capabilities (although it is great).
Is this feasible?
Yes it is feasible. Google has done that (and it does have comments). So has Adobe. I'm sure there is more.
Xopus provides a programmable platform that allows you to define editable XML within a WYSIWYG environment. You could use it to define what you want to edit (XML), against which rules you want to edit it (an XSD) and how you want it to look while you edit it (XSL). Then you tie that all together with the Javascript API.
In other words, you could pretty easily define a document that contains multiple paragraphs with optional comments and then have them displayed as bubbles exactly the way you want them; when saved, a script on the server could be executed that converts the XML to a Word document.
Take a look at the demos.
If they are Word 2007 documents, you can use Silverlight. Here's an example application that uses Silverlight to open a Word 2007 document and display it in the browser.
Since StackOverflow is a programmer site, I'll assume you're a programmer. You can use Silverlight to add the bubbles and annotations to a Word 2007 document, but you'll need to know VB.NET or C#.
Take a look at docx2web.appspot.com which is (currently) a very bare bones editor with the distinguishing feature that the browser is directly manipulating (more or less) the "flat OPC" version of the docx.
This means that there is no lossy conversion on either the way in or the way out. So for example, when you save after editing, anything which was in the original docx is round tripped back to Word.
As far as support for older .doc is concerned, POI can be used to convert them to .docx (although your mileage may vary).
Why are you trying to compete with google docs?
I know that TinyMCE provides some rich controls for in browser editing. Last time i looked at it, it had 100% of the stuff i would normally use in word, and then some. On the other hand, i probably has 1% of the features that MS word provides. It would be VERY difficult to implement it all.
As far as saving to MS word compatible format. i am sure its possible. it would probably be easier to save to a non-doc format.
As far as popups etc, those can be easy built using jquery UI or any other javascript framework.
Bottom line: yes, its possible, but why?!
It is possible. For example eyeOS has a text processing application able to open and process Microsoft Office and OpenOffice.org text documents.

Resources