Google docs style comments bound to text section - django

I am working on a project, in which documents are edited and stored in multiple revisions. As a part of the editing process, it should be possible to write comments and tie these to specific sections in the document text.
What I imagine is something close to what Google Docs does. In Google Docs, you can highlight any text element and click "Write comment". The comment will then track the text, so it is clear what exactly has been commented on.
Now I can easily imagine making something similar to this, where - when rendering the page - the document will simply be searched and the occurrence of the commented text will be highlighted, however, there are multiple problems.
Imaging this example. My document reads:
foo bar is the bar of fooness
Now I highlight this part of the text
foo >>bar<< is the bar of fooness
and write some comment. When i render the document, the first occurence of bar will be highlighted. But what if I had commented on the second occurence of bar? That wouldn't work. What if the first occurence of bar is deleted in the next revision? Then nothing should be highlighted, even though an instance of bar exists, since the subject was removed.
So the question is: How do I store comments that refer to a specific part of a document, that will change throughout revisions? Is this a known concept that I could read about? If so, what is it called?
The specific context is a Django app, where the document is written in the Ace editor en read as HTML. Everything happens in the browser.

Related

How to hide the header on an Xsl Fo, page overflow

I have a header, a body, and a footer set up for an Xsl Fo page sequence. There are certain items displayed on this page in blocks with a keep-together.within-page value of 1. This works really well for the most part, but I've noticed that when stuff that will span an entire page or more absolutely has to break it will end up on a new page and then get cut (which is fine) but then the header gets drawn in the middle of this making everything look a little gross/confusing (not fine) as whatever remains is drawn onto the next page.
So I'm wondering, is there some way to suppress the header on content overflow into the next page?
Or is there some way with alternative page sequences or something to achieve what I want?
Sorry for the vagueness here, and a lack of a current working representation of what's going on. I am very new to Xsl Fo, and most of our working code is under an abstracted framework, but if I knew of the correct directives or if this was possible I'm sure I could implement them into the framework and get things working.
Edit: I have attached a picture to hopefully clarify what is going on
You could put the content that you want to hide in an fo:marker and use fo:retrieve-marker in the fo:static-content that flows into the 'region-before' region.
The trick is to put a copy of the 'real' fo:marker before each of the blocks with the keep-together and also put an empty fo:marker with the same marker-class-name as the first thing inside the block. (I don't know what your XSL-FO markup is like, but you may need to put an fo:wrapper around each block as a place to put the 'real' marker.)
If retrieve-position is first-including-carryover (see https://www.w3.org/TR/xsl11/#retrieve-position), then you should get an empty fo:marker for blocks that broke across the page boundary and get the 'real' fo:marker on other pages.

docmosis - repeating row (or section) is not wrapping big text

I try to integrate docmosis into my product, using the docmosis-java.
I’ve encountered an issue where there is a Java object that contains a member with huge text.
I have declared a repeating-row in my template (as I may have more than one instance from this type). In this case, the text (which is huge, contains many pages) appears partially in the report; only a single page is shown; it seems that instead of wrapping to the next page, to show the rest of the text, it is cut hence invisible in the report.
This is my template:
As mentioned, when “getBody()” return HUGE text, it is not visible in the report – only the first page of it.
Any ideas?
It looks like your template is using a table. If so, you should check that your table allows the rows to break across pages. If this is disabled, it is likely to produce only partial results since you have said the row must be on a a single page.
Does that help?

Does XSLFO support fixed layout?

I am using xslfo to generate PDF from my XML file, but whenever I edit something in my source documents, it will impact on pagination of output, that cause some indexing issue that runs according to there appearance.
Are there any attributes or elements to handle or to fix this behaviour?
I assume you have the following situation:
Initially, a page is almost filled with text.
The text is edited and becomes longer. Now it doesn't fit on one page any more.
You want to know if there's a way to automatically change the formatting so the text will fit on one page again.
Unfortunately you can't do this with XSL-FO alone. As far as I know, there is no way to specify "this block of text has to fit on one page, and if it doesn't fit, make the font size smaller until it fits".
You'd have to do some post-processing, along the line of 'count the pages in the PDF, if the page count is larger than X, change a variable in the FO template to make the text smaller and render again'.

Doxygen pdf output: links for c++ classes in index don't work properly

Peculiar problem. The page links in the TOC and in the Class Index at the top of the document work fine. Clicking on the hyperlinked page number takes you to the right place in the document.
However, in the index section at the very end of the document, the page links here take you to about where the class is documented, but always one or two pages before.
This would be confusing for someone who doesn't know this problem exists. Not sure where it comes from though - doxygen or latex.
I run latex twice (have tried running it more times, but this makes no difference).
Any ideas?

Word 2003 Template - document saving

We have a word 2003 template we use as the basis for a configuration sheet for a system. The whole thing is based around form fields and the template is then locked. To write a new document we double click on the template, fill in the form fields, save and off we go.
The problem Ive got is that when finished writing in the "doc" file and closing or saving I always get a dialog asking if I want to save changes to the template as well. Even if I just double click the template "dot" file so that a blank "doc" file based on this is opened and then close that document straightaway I still get the save template query.
Is there anyway I can get rid of it as its damned annoying to everyone who uses the template.
Many thanks
Further note:
I've just had Word 2003 opened with no documents or templates opened. I use file open and open the template. Once it is open I then close it again. No "do you want to save" messages. I then use windows explorer and double click on the same template to create a document. I wait til the document is sitting in word ready to use. I then click close again without typing or changing anything - After the do you want to save changes to "Document 2" which I say no to, I then get the "do you want to save the template" message.
Further further note:
I have now tracked this to some code I have that adds a toolbar and buttons. within this code is a line customizationcontext = Thisdocument and then the toolbar and buttons are created. If I change the line to CustomizationContext = ActiveDocument I then do not get the prompt for saving when I close a document created from the template. I do however now get the prompt if I open the template and close it without changing anything(also the buttons I added do not appear correctly (but they do appear in the document))! I can live with this though as it is preferable than the other way round.
The most common reason for this to happen, is that one of your formats (paragraph or other) is marked to update the source template if changed.
Check all the used formats in your template if the option to save back changes is activated and de-activate this option - the same applies to any .doc already created from this template since it will carry over this option.
To check your formats (in Word 2003), open the sidebar for styles and formatting, change the filter at the bottom to "Used formats". Move your pointer over the format you like to inspect and select the action "Modify..." from the pull down menu at the right.
On the bottom right - just above the OK-button - you'll find the checkbox labeled "Automatically update".
See also Automatically update a paragraph style.