Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 11/28/2011 08:29 AM, txapollo243 wrote:
I was wondering if there is a nice way of  formatting source code snippets
in LibreOffice Writer (I use the 3.3.2 version). I know it can be done
manually by changing the source code's paragraph's font to something
distinct like Courier or Courier New, but I am looking for something more
aesthetically pleasing. I mean not only using an appropriate font, but also
reserved words-specific coloring, indentation, e.t.c. Is there a plugin to
do this? The question came to me because of an 8085 Assembly project at my
university, in which we have to provide reports to our instructor, but
certainly it could also be useful for writing reports for projects based on
other programming languages.

I take it that you need to format 8085 Assembler.... Is this correct?


If you are willing to do a bit of work yourself, I am willing to write the parser and integrate this into the extension. The extension currently only supports: Basic, C++, Java, Perl, Python, R, XML, and C#. I have not done assembly in years, so I am very rusty on the syntax and similar.

The colorizer recognizes the following things and colorizes them separately:

Comments
Literals
Keywords
Identifiers
Special characters (such as periods, commas, parenthesis, etc).

Things I would require (that we can work out in private email):

(1) List of keywords
(2) list of special characters
(3) How to identify comments
(4) What do I need to know to format the listings?
(5) What colors might be common for the identified types?

For item (4), it may be as simple as

<white space> <tokens><white space><operands and such>
<label>:

Stuff like that so we can determine if this is sufficient. Perhaps you need to recognize registers using a different character style.




--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.