First time here? Check out the FAQ!
I'd really like a place where I could play around with formatting for this site, the way that many wikis have "Playgrounds" or playground-style pages.
This would make it easier for us to experiment with new types of links or formatting without spamming the front page with nonsense questions or bogus edits.
It seems that most Markdown implementations allow the definition of reference-style links. Does this work here?
The LibreOffice suite is free software and is cross-platform.
Yes, it does work! The definition of the link is hidden as it should be. It goes like this:
[libo-on-wikipedia]: https://en.wikipedia.org/wiki/LibreOffice "LibreOffice on Wikipedia"
Below every post there's a live preview ... that should help, no?
Testing out how long it takes to post a new answer!
Let's put at least a little content in here...
New test: URLs that don't want to link!
Ordinary urls like to be linked:
Some URLs don't like to be linked:
URLs with a hash in them:
URLs with parenthesis:
https://en.wikipedia.org/wiki/Cheese_(software)
And with [ ] ( ) syntax:
What if the URL has a paren, just not on the end?
Fixes? Workarounds? Hooray!
Let's try to use the [ ] ( ) syntax!
[http://productforums.google.com/forum/#!topic/docs/S6IkdnuH91E](http://productforums.google.com/forum/#!topic/docs/S6IkdnuH91E)
For the paren on the end, use a backslash "\" to quote just that single character, like this:
[cheese webcam software](https://en.wikipedia.org/wiki/Cheese_(software\))
If the paren is not on the end, can we just slap parens around the whole shebang?
[cheese webcam software - References section](https://en.wikipedia.org/wiki/Cheese_(software)#References)
Hmm... looks like a no. Let's try escaping that inner r-paren:
[cheese webcam software - References section](https://en.wikipedia.org/wiki/Cheese_(software\)#References)
Testing linking behavior here:
What other types of linking would be helpful? Possible sites include
It would also be very helpful to be able to have shortcuts for default responses, such as:
testing this one out
Code commenting styles -- what works, what doesn't work, etc.
/* Some C-style code */
#include <stdio.h>
int main(void) {
printf("hello, world\n"); /* End of line comment */
}
C works pretty well.
Java?
// Some Java code
class HelloLibO {
public static void main(String[] args) {
System.out.println("Hello World!"); // End of line comment
}
}
Java looks pretty good!
How about Python?
# A Hello-world function (with some extra stuff thrown in).
def HelloWorld(s):
print("Hello world")
for foo in bar
if passes(foo)
print '%s' % foo
else:
print "Fails!"
Multi-line comments?
""" Multi-line comment in Python
probably isn't going to work right now
"""
No, not working too well.
LibreOffice Basic?
' This is a Hello World snippet.
print "Hello, world!"
Hmm... the formatter hates the unclosed single-quote. Let's try again using 'REM'
REM This is a Hello World snippet.
print "Hello, world!"
A little better, but the comment is still being highlighted like code, not a comment. Let's try again, using either a C++-style or Bash-style comment.
REM // This is a Hello World function.
REM # Hopefully these comments will render as expected!
Sub Main
print "Hello, world!" REM # End of line comment.
End Sub
Here's some more LO Basic as a formatting example (from this question):
Sub Main
Set thisBook = ThisComponent
studentsSheet = thisBook.Sheets.getByName("Students")
i = 0
Do
c = studentsSheet.getCellByPosition(0, i)
REM // Stop creating sheets for students once we find a
REM // row with no name.
If c.Type = com.sun.star.table.CellContentType.EMPTY Then
print "Exiting: Found row with no student name."
Exit Do
EndIf
studentName = c.String
sNew = thisBook.createInstance("com.sun.star.sheet.Spreadsheet")
thisBook.Sheets.insertByName(studentName, sNew)
i = i + 1
REM // Sanity-check on looping forever. We don't expect
REM // to have over 1000 students.
Loop Until i > 1000
End Sub
Here's an upstream post about the code behind the syntax highlighting: http://askbot.org/en/question/3026/syntax-highlighting/
Looks like it's https://code.google.com/p/google-code-prettify/
Also see https://google-code-prettify.googlecode.com/svn/trunk/README.html -- looks like it might be possible to pass-along the language name and get a bit better highlighting. We might need to add a new language handler if LO Basic and Visual Basic use a different grammar.
quoting styles
Blockquote
PRE/CODE here
foo@bar:~/$ for i in blah; do echo harumph; done
LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!
Asked: 2012-06-28 06:07:41 +0200
Seen: 214 times
Last updated: May 09
Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
testing fdo#1234 syntax
qubit ( 2012-06-28 06:07:59 +0200 )edityou just created one... :-)
cloph ( 2012-07-25 22:14:40 +0200 )edit