Page MenuHomePhabricator

Remarkup Demo
Updated 2,398 Days AgoPublic

Remarkup Examples

Edit this page to see how each of the items was made.


bold text
italic text
underlined text
strikethrough text
highlighted text

bold, italic, highlighted text that has been crossed out

Make this italic and then keep typing
and typing
and typing.


Header 1

Header 2

Header 3

Header 4
Header 5
Very Tiny Header

  • Item 1
  • Item 2
  • Item 3
  • and so on
  • Graphics
    • Anari
      • 1
      • 2
      • 3
        • A
        • B
        • C
    • Lightrift
    • Punchline
  • Content
    • Ratscript
    • Trailcrest
    • SIMPLEXpress
  1. First item.
  2. Second item.
  3. Second second item.
  4. Third item.
  5. Fourth item.
  • This is step 1.
  • This is step 2.
  • This is step 3.

Monospaced text.

Ratscript Hello World
make msg1 = "Hello, "
make msg2 = "world!"
print(msg1 + msg2)
C++ Hello World
#include <iostream>
using namespace std;

int main()
{
   string msg1 = "Hello, "
   string msg2 = "world!"
   cout << msg1 << msg2 << endl;
   return 0;
}
thisIsSomeVeryBadCode();

NOTE: This is a note in a blue box.
WARNING: This is a warning in a yellow box.
IMPORTANT: This is important and is in a red box.
This is a note.
This is a warning.
This is important.

DuckDuckGo
Maniphest
Resources

T109: Search/Sort Algorithms D99: Test Framework v1

1/*!
2 * Overcomplicated Hello world! application
3 * by andywestken
4 * http://www.cplusplus.com/forum/lounge/79437/
5 *
6 * \file hello.cpp
7 */
8
9#include <iostream>
10#include <vector>
11#include <algorithm>
12#include <functional>
13#include <cassert>
14
15/*!
16 * Dispay message.
17 */
18void displayMessage();
19
20/*!
21 * Sentence type
22 *
23 * Type of sentence, used to decide how to terminate sentence.
24 */
25enum ESentenceType {
26 eStatement,
27 eExclamation,
28 sQuestion,
29 eCommand
30};
31
32/*!
33 * Utility class to prevent unintended copying of class instances.
34 */
35class nonCopyable {
36protected:
37 nonCopyable() {
38 }
39
40 ~nonCopyable() {
41 }
42
43private:
44 nonCopyable(const nonCopyable&);
45 const nonCopyable& operator=(const nonCopyable&);
46};
47
48/*!
49 * Utility function to obtain punctuation mark to end sentence
50 * of specified type.
51 */
52inline char getPunctionMark(ESentenceType sentenceType) {
53 char puncMark = '.';
54 switch(sentenceType) {
55 case eStatement : puncMark = '.'; break;
56 case eExclamation: puncMark = '!'; break;
57 case sQuestion : puncMark = '?'; break;
58 case eCommand : puncMark = '.'; break;
59 default: {
60 // should never get here
61 assert(false);
62 }
63 }
64 return puncMark;
65}
66
67/*!
68 * Utility class for creation of instances.
69 */
70template<typename TElem>
71class Creatable {
72protected:
73 Creatable() {
74 }
75
76 virtual ~Creatable() {
77 clear();
78 }
79
80public:
81 static TElem* create() {
82 TElem* e = new TElem;
83 return e;
84 }
85
86 void free() {
87 delete this;
88 }
89
90 virtual void clear() {
91 }
92};
93
94template<typename TElem, typename TParam>
95class CreatableParam {
96protected:
97 CreatableParam() {
98 }
99
100 virtual ~CreatableParam() {
101 }
102
103public:
104 static TElem* create(TParam p) {
105 TElem* e = new TElem;
106 e->initialize(p);
107 return e;
108 }
109
110 void free() {
111 finalize();
112 delete this;
113 }
114
115 virtual void initialize(TParam /*p*/) {
116 }
117
118 virtual void finalize() {
119 clear();
120 }
121
122 virtual void clear() {
123 }
124};
125
126/*!
127 * Base class for displayable content
128 */
129class DisplayElem
130: public nonCopyable {
131protected:
132 DisplayElem() {
133 }
134
135 virtual ~DisplayElem() {
136 }
137
138public:
139 virtual void display(std::ostream& os) const = 0;
140};
141
142/*!
143 * STL algorithm for displaying elements
144 */
145class Displayer
146: public std::unary_function<void, const DisplayElem*> {
147private:
148 std::ostream& m_os;
149 char m_sep;
150 size_t m_count;
151
152public:
153 Displayer(std::ostream& os, char sep = '\0')
154 : m_os(os)
155 , m_sep(sep)
156 , m_count(0) {
157 }
158
159 ~Displayer() {
160 }
161
162 void operator()(const DisplayElem* e) {
163 if(('\0' != m_sep) && (0 < m_count)) {
164 m_os << m_sep;
165 }
166 e->display(m_os);
167 ++m_count;
168 }
169};
170
171/*!
172 * STL algorithm for freeing display elements
173 */
174template <typename TElem>
175class Freer
176: public std::unary_function<void, TElem*> {
177public:
178 void operator()(TElem* e) {
179 e->free();
180 }
181};
182
183/*!
184 * Display element for letter.
185 *
186 * The letter is the fundamental element: it has no substructure.
187 */
188class Letter
189: public DisplayElem
190, public CreatableParam<Letter, char> {
191private:
192 char m_ch;
193
194protected:
195 /*virtual*/ ~Letter() {
196 }
197
198public:
199 Letter() : m_ch('\0') {
200 }
201
202 void initialize(char ch) {
203 m_ch = ch;
204 }
205
206 void finalize() {
207 m_ch = '\0';
208 }
209
210 void display(std::ostream& os) const {
211 os << m_ch;
212 // no endLetter()
213 }
214};
215
216/*!
217 * Display element for word.
218 *
219 * A word is a sequence of letters.
220 */
221class Word
222: public DisplayElem
223, public Creatable<Word> {
224private:
225 std::vector<Letter*> m_letters;
226
227protected:
228 /*virtual*/ ~Word() {
229 clear();
230 }
231
232public:
233 Word() {
234 }
235
236 void clear() {
237 std::for_each(m_letters.begin(), m_letters.end(), Freer<Letter>());
238 m_letters.clear();
239 }
240
241 void addLetter(Letter* s) {
242 m_letters.push_back(s);
243 }
244
245 /*virtual*/ void display(std::ostream& os) const {
246 std::for_each(m_letters.begin(), m_letters.end(), Displayer(os));
247 // no endLetter()
248 }
249};
250
251/*!
252 * Display element for sentence.
253 *
254 * A sentence is a sequence of words.
255 */
256class Sentence
257: public DisplayElem
258, public CreatableParam<Sentence, ESentenceType> {
259private:
260 std::vector<Word*> m_words;
261
262 ESentenceType m_sentenceType;
263
264protected:
265 /*virtual*/ ~Sentence() {
266 clear();
267 }
268
269 void endSentence(std::ostream& os) const {
270 const char puncMark = getPunctionMark(m_sentenceType);
271 os << puncMark;
272 }
273
274public:
275 Sentence()
276 : m_sentenceType(eStatement) {
277 }
278
279 void initialize(ESentenceType sentenceType) {
280 m_sentenceType = sentenceType;
281 }
282
283 void finalize() {
284 m_sentenceType = eStatement;
285 }
286
287 void clear() {
288 std::for_each(m_words.begin(), m_words.end(), Freer<Word>());
289 m_words.clear();
290 }
291
292 void addWord(Word* w) {
293 m_words.push_back(w);
294 }
295
296 void display(std::ostream& os) const {
297 std::for_each(m_words.begin(), m_words.end(), Displayer(os, ' '));
298 endSentence(os);
299 }
300};
301
302/*!
303 * Display element for message.
304 *
305 * A message is a sequence of sentences.
306 */
307class Message
308: public DisplayElem
309, public Creatable<Message> {
310private:
311 std::vector<Sentence*> m_sentences;
312
313protected:
314 /*virtual*/ ~Message() {
315 clear();
316 }
317
318 void endMessage(std::ostream& os) const {
319 os << std::endl;
320 }
321
322public:
323 Message() {
324 }
325
326 void clear() {
327 std::for_each(m_sentences.begin(), m_sentences.end(), Freer<Sentence>());
328 m_sentences.clear();
329 }
330
331 void addSentence(Sentence* s) {
332 m_sentences.push_back(s);
333 }
334
335 void display(std::ostream& os) const {
336 std::for_each(m_sentences.begin(), m_sentences.end(), Displayer(os, ' '));
337 endMessage(os);
338 }
339};
340
341/*!
342 * Main entrance point.
343 */
344int main() {
345 displayMessage();
346 return 0;
347}
348
349/*!
350 * Display message.
351 */
352void displayMessage() {
353 Word* first_word = Word::create();
354 first_word->addLetter(Letter::create('H'));
355 first_word->addLetter(Letter::create('e'));
356 first_word->addLetter(Letter::create('l'));
357 first_word->addLetter(Letter::create('l'));
358 first_word->addLetter(Letter::create('o'));
359
360 Word* second_word = Word::create();
361 second_word->addLetter(Letter::create('w'));
362 second_word->addLetter(Letter::create('o'));
363 second_word->addLetter(Letter::create('r'));
364 second_word->addLetter(Letter::create('l'));
365 second_word->addLetter(Letter::create('d'));
366
367 Sentence* sentence = Sentence::create(eExclamation);
368 sentence->addWord(first_word);
369 sentence->addWord(second_word);
370
371 Message* message = Message::create();
372 message->addSentence(sentence);
373
374 message->display(std::cout);
375
376 message->free();
377 // sentences, etc freed by parent
378}
{U1} {M4}

T109 D99 P3 U1 M4

@jcmcdonald

Ratscript [Project]


This is some quoted text.



Macro _igotthis_: Writing stuff in Remarkup? Yeah, I got this.





FruitColorPricePeel?Source
Applered$0.93noYakima
Bananayellow$0.19YES

HomeGrocery StoreProduce SectionLemons

Step 1Step 2Step 3Step 4


(I dragged and dropped this image to attach it.)

precocious-bruno.png (771×685 px, 49 KB)

This character appears in Precocious.

Last Author
jcmcdonald
Last Edited
Jan 15 2016, 6:46 PM