Change the wiki grabber macro definition.
Now looks more like the description part, backwards compability layer is still there. (The output of the wiki grabber tool didn't change with this commit.)
This commit is contained in:
parent
671aa778f1
commit
d776161ab8
17 changed files with 43 additions and 41 deletions
|
@ -53,11 +53,11 @@ twidget* tbuilder_button::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = button_description
|
||||
* @begin{macro}{button_description}
|
||||
*
|
||||
* A button is a control that can be pushed to start an action or
|
||||
* close a dialog.
|
||||
* @end_macro
|
||||
* A button is a control that can be pushed to start an action or close
|
||||
* a dialog.
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -64,12 +64,12 @@ twidget* tbuilder_drawing::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = drawing_description
|
||||
* @begin{macro}{drawing_description}
|
||||
*
|
||||
* A drawing is widget with a fixed size and gives access to the
|
||||
* canvas of the widget in the window instance. This allows special
|
||||
* display only widgets.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -116,12 +116,12 @@ twidget* tbuilder_horizontal_listbox::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = horizontal_listbox_description
|
||||
* @begin{macro}{horizontal_listbox_description}
|
||||
*
|
||||
* A horizontal listbox is a control that holds several items of the
|
||||
* same type. Normally the items in a listbox are ordered in rows,
|
||||
* this version orders them in columns instead.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -48,12 +48,12 @@ twidget* tbuilder_horizontal_scrollbar::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = horizontal_scrollbar_description
|
||||
* @begin{macro}{horizontal_scrollbar_description}
|
||||
*
|
||||
* A horizontal scrollbar is a widget that shows a horizontal scrollbar.
|
||||
* This widget is most of the time used in a container to control the
|
||||
* scrolling of its contents.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -48,10 +48,9 @@ twidget* tbuilder_image::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = image_description
|
||||
*
|
||||
* An image shows a static image.
|
||||
* @end_macro
|
||||
* @begin{macro}{image_description}
|
||||
* An image shows a static image.
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -53,11 +53,11 @@ twidget* tbuilder_label::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = label_description
|
||||
* @begin{macro}{label_description}
|
||||
*
|
||||
* A label displays a text, the text can be wrapped but no scrollbars
|
||||
* are provided.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -130,12 +130,12 @@ twidget* tbuilder_listbox::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = listbox_description
|
||||
* @begin{macro}{listbox_description}
|
||||
*
|
||||
* A listbox is a control that holds several items of the same type.
|
||||
* Normally the items in a listbox are ordered in rows, this version
|
||||
* might allow more options for ordering the items in the future.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -48,12 +48,12 @@ twidget* tbuilder_minimap::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = minimap_description
|
||||
* @begin{macro}{minimap_description}
|
||||
*
|
||||
* A minimap to show the gamemap, this only shows the map and has no
|
||||
* interaction options. This version is used for map previews, there
|
||||
* will be a another version which allows interaction.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -92,12 +92,12 @@ twidget* tbuilder_multi_page::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = multi_page_description
|
||||
* @begin{macro}{multi_page_description}
|
||||
*
|
||||
* A multi page is a control that contains several 'pages' of which
|
||||
* only one is visible. The pages can contain the same widgets containing
|
||||
* the same 'kind' of data or look completely different.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -57,13 +57,13 @@ twidget* tbuilder_panel::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = panel_description
|
||||
* @begin{macro}{panel_description}
|
||||
*
|
||||
* A panel is an item which can hold other items. The difference
|
||||
* between a grid and a panel is that it's possible to define how a
|
||||
* panel looks. A grid in an invisible container to just hold the
|
||||
* items.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -48,10 +48,9 @@ twidget* tbuilder_progress_bar::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = progress_bar_description
|
||||
*
|
||||
* A progress bar shows the progress of a certain object.
|
||||
* @end_macro
|
||||
* @begin{macro}{progress_bar_description}
|
||||
* A progress bar shows the progress of a certain object.
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -48,12 +48,12 @@ twidget* tbuilder_repeating_button::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = repeating_button_description
|
||||
* @begin{macro}{repeating_button_description}
|
||||
*
|
||||
* A repeating_button is a control that can be pushed down and repeat a
|
||||
* certain action. Once the button is down every x milliseconds it is
|
||||
* down a new down event is triggered.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -65,12 +65,12 @@ twidget* tbuilder_scroll_label::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = scroll_label_description
|
||||
* @begin{macro}{scroll_label_description}
|
||||
*
|
||||
* A scroll label is a label that wraps its text and also has a
|
||||
* vertical scrollbar. This way a text can't be too long to be shown
|
||||
* for this widget.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -84,11 +84,9 @@ twidget* tbuilder_slider::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = slider_description
|
||||
*
|
||||
* A slider is a control that can select a value by moving a grip on a
|
||||
* groove.
|
||||
* @end_macro
|
||||
* @begin{macro}{slider_description}
|
||||
* A slider is a control that can select a value by moving a grip on a groove.
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -59,11 +59,11 @@ twidget* tbuilder_spacer::build() const
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = spacer_description
|
||||
* @begin{macro}{spacer_description}
|
||||
*
|
||||
* A spacer is a dummy item to either fill in a widget since no empty
|
||||
* items are allowed or to reserve a fixed space.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -97,14 +97,14 @@ tbuilder_tree_view::tnode::tnode(const config& cfg)
|
|||
} // namespace gui2
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @start_macro = tree_view_description
|
||||
* @begin{macro}{tree_view_description}
|
||||
*
|
||||
* A tree view is a control that holds several items of the same or
|
||||
* different types. The items shown are called tree view nodes and when
|
||||
* a node has children, these can be shown or hidden. Nodes that contain
|
||||
* children need to provide a clickable button in order to fold or
|
||||
* unfold the children.
|
||||
* @end_macro
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
|
|
|
@ -499,6 +499,10 @@ if __name__ == "__main__":
|
|||
data = macro_regex.sub(lambda match: instanciate_macro(match), data)
|
||||
return data
|
||||
|
||||
def create_macro_old(macro):
|
||||
print "Found old style macro '%s'" % macro.group(1)
|
||||
create_macro(macro)
|
||||
|
||||
def create_macro(macro):
|
||||
"""Wrapper for creating macros."""
|
||||
|
||||
|
@ -525,6 +529,8 @@ if __name__ == "__main__":
|
|||
current_block = i[0]
|
||||
section = reindent(i[1])
|
||||
macro_regex = re.compile("^@start_macro *= *(.*?)\n(.*?)\n@end_macro.*?$", re.M | re.S)
|
||||
macro_regex.sub(lambda match: create_macro_old(match), section)
|
||||
macro_regex = re.compile("^@begin{macro}{(.*?)}\n(.*?)\n@end{macro}.*?$", re.M | re.S)
|
||||
macro_regex.sub(lambda match: create_macro(match), section)
|
||||
|
||||
def process_directory_macros(dir):
|
||||
|
|
Loading…
Add table
Reference in a new issue