Editing Documentation:How to use the Parser
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
Before reading this article you need to be familiar with the basic syntax of events in a layer, which is described | Before reading this article you need to be familiar with the basic syntax of events in a layer, which is described here. | ||
You can open the Parser by clicking the | You can open the Parser by clicking the Parser button in the bottom right corner of the Editor. | ||
[[File:ParserButton.png|600px]] | [[File:ParserButton.png|600px]] | ||
Line 10: | Line 10: | ||
==The workflow== | ==The workflow== | ||
You need to put the source text (usually wiki text from a Wikipedia article) in the left field. Then, using the buttons at the bottom you highlight the needed information in the text: event texts and dates. The techniques for doing that will be described in this article. After that you click | You need to put the source text (usually wiki text from a Wikipedia article) in the left field. Then, using the buttons at the bottom you highlight the needed information in the text: event texts and dates. The techniques for doing that will be described in this article. After that you click ‘Move selected’ button and the data is moved into the right field. Usually you need to format the data a bit more using the buttons below the right text field and then you can copy the resulting text and paste it into the Editor so that you can test the data on the timeline. | ||
==Example== | ==Example== | ||
Let’s use US presidents as an example. Suppose you want to create a layer of US presidents (even though such layer already exists). | Let’s use US presidents as an example. Suppose you want to create a layer of US presidents (even though such layer already exists). | ||
First, you’d go to the corresponding | First, you’d go to the corresponding Wikipedia page and open its source wiki text. | ||
[[File:EditSource.png|300px]] | [[File:EditSource.png|300px]] | ||
Line 25: | Line 25: | ||
Now you need to mark all the presidents with red color, and all the dates with orange color. You can see that in the left bottom corner of the screen there is a button that is red already. And it says ‘Texts’. Thats exactly what we need. That means we are in the text selection mode. To select dates you will need to change the mode to single date selection mode or double dates selection mode. For now don’t do anything with the red button. | Now you need to mark all the presidents with red color, and all the dates with orange color. You can see that in the left bottom corner of the screen there is a button that is red already. And it says ‘Texts’. Thats exactly what we need. That means we are in the text selection mode. To select dates you will need to change the mode to single date selection mode or double dates selection mode. For now don’t do anything with the red button. | ||
If you click | If you click ‘Select’ button, by default all the links will be selected: | ||
[[File:PresidentsTooMuchLinks.png|500px]] | [[File:PresidentsTooMuchLinks.png|500px]] | ||
Line 31: | Line 31: | ||
You can manually unhighlight all the links that you don’t need (by selecting a range of text containing the highlighted parts and pressing Option/Alt key on the keyboard), but that’s too much work. | You can manually unhighlight all the links that you don’t need (by selecting a range of text containing the highlighted parts and pressing Option/Alt key on the keyboard), but that’s too much work. | ||
Instead let’s do something else. First, clear the selection by clicking | Instead let’s do something else. First, clear the selection by clicking ‘Clear’ button. | ||
Now let’s pay attention to the fact that all the links containing presidents’ names are enclosed in triple apostrophes like this: <code><nowiki>'''[[George Washington]]'''</nowiki></code>. We can use this fact to our advantage. | Now let’s pay attention to the fact that all the links containing presidents’ names are enclosed in triple apostrophes like this: <code><nowiki>'''[[George Washington]]'''</nowiki></code>. We can use this fact to our advantage. | ||
Put prefix <code><nowiki>'''[[</nowiki></code> and postfix <code><nowiki>]]'''</nowiki></code> in the two small input fields, and then click | Put prefix <code><nowiki>'''[[</nowiki></code> and postfix <code><nowiki>]]'''</nowiki></code> in the two small input fields, and then click Select button. | ||
[[File:PrefixPostfixExample.png|300px]] | [[File:PrefixPostfixExample.png|300px]] | ||
Line 43: | Line 43: | ||
[[File:Presidents_Links.png|500px]] | [[File:Presidents_Links.png|500px]] | ||
Click the red button to change it to orange. To find dates just click the | Click on the red button to change it to orange. To find dates just click the ‘Find dates’ button. As you can see all the dates are highlighted, even the ones we don’t need. | ||
[[File:PresidentsTooMuchDates.png|500px]] | [[File:PresidentsTooMuchDates.png|500px]] | ||
Now you have to manually unhighlight the ones that are not needed, by selecting parts of text with a mouse and pressing | Now you have to manually unhighlight the ones that are not needed, by selecting parts of text with a mouse and pressing Option/Alt button. | ||
Once you are done, you can click | Once you are done, you can click ‘Move selected’ and the data will be moved into the right field with almost correct syntax. | ||
[[File:Presidents_Almost_Done.png|800px]] | [[File:Presidents_Almost_Done.png|800px]] | ||
Now you can click | Now you can click ‘Format dates’ button to change date format: | ||
[[File:PresidentsResult.png|400px]] | [[File:PresidentsResult.png|400px]] | ||
Line 59: | Line 59: | ||
Now everything looks right. Copy the result and paste it into the Editor. | Now everything looks right. Copy the result and paste it into the Editor. | ||
==A harder task== | ==A harder task== | ||
Line 74: | Line 74: | ||
Once dates are highlighted it is easier to visually find presidents in the text. At this point you can manually select presidents' names with a mouse and highlight them using the Control key on the keyboard. But there is an easier way. You can make the syntax around the presidents' names a bit more special than that of other links. For example, you can add an asterisk in front of the opening brackets: <code><nowiki>*[[George Washington]]</nowiki></code>. | Once dates are highlighted it is easier to visually find presidents in the text. At this point you can manually select presidents' names with a mouse and highlight them using the Control key on the keyboard. But there is an easier way. You can make the syntax around the presidents' names a bit more special than that of other links. For example, you can add an asterisk in front of the opening brackets: <code><nowiki>*[[George Washington]]</nowiki></code>. | ||
Then you can add <code><nowiki>*[[</nowiki></code> and <code><nowiki>]]</nowiki></code> | Then you can add <code><nowiki>*[[</nowiki></code> and <code><nowiki>]]</nowiki></code> in the small input field and click 'Select'. Now all the presidents will be selected. | ||
[[File:PresidentsAsterisks.png|600px]] | [[File:PresidentsAsterisks.png|600px]] | ||