Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread GunChleoc
Thanks a lot for your help! :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread kaputtnik
Done.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread GunChleoc
Thanks for proofreading :)

I'm not font of the blue either, can you please try something like 6699ff? The 
problem wasn't the hue, but the saturation.

Diff comments:

> 
> === modified file 'src/graphic/text/rt_parse.cc'
> --- src/graphic/text/rt_parse.cc  2017-12-09 06:29:26 +
> +++ src/graphic/text/rt_parse.cc  2018-02-24 11:18:33 +
> @@ -194,30 +247,92 @@
>   tc.has_closing_tag = true;
>   tag_constraints_["rt"] = tc;
>   }
> - {  // br tag
> + {
> + /* RST
> +.. _rt_tags_div:
> +
> +Division -- 
> +-
> +
> +This tag defines a rectangle and an be used as a layout control.
> +
> +Attributes
> +^^
> +
> +The same attributes as :ref:`rt_tags_rt`, plus the following:
> +
> +* **margin**: Shrink all contents to leave a margin towards the outer edge 
> of this tag's rectangle
> +* **float**: To be implemented. Allowed values are ``left``,  ``right``
> +* **valign**: Align the contents vertically. Allowed values are ``top`` 
> (default), ``center`` = ``middle``, ``bottom``.

Good idea, but I don't want to change this right now. It would mean retesting 
all the scenarios.

> +* **width**: The width of this element, as a pixel amount, or as a 
> percentage.
> +  The last ``div`` in a row can be expanded automatically by using ``*``.
> +
> +Sub-tags
> +
> +
> +* :ref:`rt_tags_div`
> +* :ref:`rt_tags_font`
> +* :ref:`rt_tags_p`
> +* :ref:`rt_tags_vspace`
> +
> +:ref:`Return to tag index`
> + */
> + TagConstraint tc;
> + tc.allowed_attrs.insert("padding");
> + tc.allowed_attrs.insert("padding_r");
> + tc.allowed_attrs.insert("padding_l");
> + tc.allowed_attrs.insert("padding_b");
> + tc.allowed_attrs.insert("padding_t");
> + tc.allowed_attrs.insert("margin");
> + tc.allowed_attrs.insert("float");
> + tc.allowed_attrs.insert("valign");
> + tc.allowed_attrs.insert("background");
> + tc.allowed_attrs.insert("width");
> +
> + tc.allowed_children.insert("p");
> + tc.allowed_children.insert("vspace");
> + tc.allowed_children.insert("font");
> + tc.allowed_children.insert("div");
> +
> + tc.text_allowed = false;
> + tc.has_closing_tag = true;
> + tag_constraints_["div"] = tc;
> + }
> + {
> + /* RST
> +.. _rt_tags_br:
> +
> +Line Break -- 
> +--
> +
> +A single line break. Use sparingly for things like poetry stanzas.
> +If you are starting a new paragraph, use :ref:`rt_tags_p` instead.
> +
> +:ref:`Return to tag index`
> + */
>   TagConstraint tc;
>   tc.text_allowed = false;
>   tc.has_closing_tag = false;
>   tag_constraints_["br"] = tc;
>   }
> - {  // img tag
> - TagConstraint tc;
> - tc.allowed_attrs.insert("src");
> - tc.allowed_attrs.insert("ref");
> - tc.allowed_attrs.insert("color");
> - tc.allowed_attrs.insert("width");
> - tc.text_allowed = false;
> - tc.has_closing_tag = false;
> - tag_constraints_["img"] = tc;
> - }
> - {  // vspace tag
> - TagConstraint tc;
> - tc.allowed_attrs.insert("gap");
> - tc.text_allowed = false;
> - tc.has_closing_tag = false;
> - tag_constraints_["vspace"] = tc;
> - }
> - {  // space tag
> + {
> + /* RST
> +.. _rt_tags_space:
> +
> +Horizontal Space -- 
> +---
> +
> +Inserts a horizontal gap between the previous and the following text.
> +This space can be filled with a character of your choice.
> +
> +Attributes
> +^^
> +
> +* **gap**: The size of the gap as a pixel amount
> +* **fill**: A character to fill the gap with
> +
> +:ref:`Return to tag index`
> + */
>   TagConstraint tc;
>   tc.allowed_attrs.insert("gap");
>   tc.allowed_attrs.insert("fill");


-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/fh1-documentation into 
lp:widelands has been updated.

Commit Message changed to:

Documented tag constraints for new font renderer and updated the main articles.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread kaputtnik
Did now some proof reading, see inline comments.

What i stumbled over is a mixed use of uppercase/lowercase after hyphen/colon. 
Eg. for the two text composition functions we have:

In join_sentence() its lowercase:
:arg sentence1: text of the first sentence

In localize lists its uppercase:
:arg items:  An array of strings



Diff comments:

> 
> === modified file 'data/scripting/richtext.lua'
> --- data/scripting/richtext.lua   2018-02-12 10:17:22 +
> +++ data/scripting/richtext.lua   2018-02-24 11:18:33 +
> @@ -232,24 +247,55 @@
>  --Closes a paragraph.
>  --
>  --:returns: The closing tags for a paragraph
> +
>  function close_p(t)
> return vspace(6) .. "" .. vspace(6)  .. ""
>  end
>  
> +
> +-- RST
> +-- .. function:: p_font(text_or_attributes[, text = nil])

The description of arguments does not match the args below.

p_font(p_or_font_attributes[, text_or_font_attributes]) ?

> +--
> +--Returns one paragraph with text followed by a small vertical gap. 
> Options
> +--can be given as first argument similar to :func:`rt`.
> +--
> +--:arg p_or_font_attributes: Optional paragraphs or font attributes.

Optional paragraph or ... ?

> +--:type p_or_font_attributes: :class:`string`
> +--
> +--:arg text_or_font_attributes: Optional font attributes or the text 
> itself.
> +--:type text_or_font_attributes: :class:`string`
> +--
> +--See the :ref:`p tag's documentation ` for a list of 
> paragraph
> +--attributes and the :ref:`font tag's documentation ` for a
> +--list of font attributes.
> +--
> +--:returns: The text wrapped in  attributes>text
> +
> +function p_font(p_or_font_attributes, text_or_font_attributes, text)
> +   if text then
> +  return (""):format(p_or_font_attributes) .. " text_or_font_attributes .. ">" .. text .. close_p()
> +   else
> +  return "" .. 
> text_or_font_attributes .. close_p()
> +   end
> +end
> +
> +-- RST
> +-- :ref:`Return to index`
> +--
> +-- Text Formatting
> +-- ^^^
> +--
> +-- This section covers convenience functions for text formatting.
> +
> +
>  -- RST
>  -- .. function:: font(attributes, text)
>  --
> ---Wraps the text in font tags.
> +--Wraps the text in font tags. See also :any:`p_font`.
>  --
> ---Allowed attributes are:
> ---   size:  the font size in pt
> ---   face:  sans, serif or condensed
> ---   color: a hex color
> ---   bold:  if you add bold=1, the text will be bold
> ---   italic:if you add italic=1, the text will be italic
> ---   underline: if you add underline=1, the text will be underlined
> ---   shadow:if you add shadow=1, the text will have a shadow
> ---   ref:   TODO(GunChleoc): I don't know what this does.
> +--:arg attributes: see the :ref:`font tag's documentation `
> +-- for a list of attributes and their descriptions.
> +--:type attributes: :class:`string`
>  --
>  --:returns: The text wrapped in font tags with the given attributes
>  
> @@ -322,18 +396,20 @@
>  --:arg text: the text of the list item
>  --
>  --:returns: li("→", text)
> +
>  function li_arrow(text)
> -- TODO(GunChleoc): Reverse arrow for rtl languages.
> return li("→", text)
>  end
>  
> +
>  -- RST
> --- .. function li_image(imagepath, text)
> +-- .. function:: li_image(imagepath, text)

Arguments doesn't match args below. text_width_percent is missing.

>  --
>  --Places a paragraph of text to the right of an image
> -
> +--
>  --:arg imagepath: the full path to the image file

"to the image file as a string" or 
:type imagepath: :class:`string`

> ---:arg text_width_percent: the percentatge of space that the text will 
> occupy
> +--:arg text_width_percent: the percentage of space that the text will 
> occupy

Is the percentage value a string? Needs it a percentage sign?

>  --:arg text: the text to be placed next to the image
>  --
>  --:returns: the text wrapped in a paragraph and placed next to the 
> image, the outer tag is a div.
> @@ -452,9 +496,92 @@
>  --:arg sentence1: text of the first sentence
>  --:arg sentence2: text of the second sentence
>  --:returns: two concatenated sentences with a localized sentence joiner.
> ---
> +
>  function join_sentences(sentence1, sentence2)
> -- TRANSLATORS: Put 2 sentences one after the other.
> -- TRANSLATORS: Languages using Chinese script probably want to lose the 
> blank space here.
> return pgettext("sentence_separator", "%s %s"):bformat(sentence1, 
> sentence2)
>  end
> +
> +
> +-- RST
> +-- .. function:: localize_list(items, listtype, former_textdomain)
> +--
> +--Turns an array of string items into a localized string list with
> +--appropriate concatenation.
> +--
> +--e.g. localize_list({"foo", "bar", baz"}, "or", "widelands") will return
> +--_"foo, bar or baz"

, "baz"

> +--
> +--:arg items:  An array of strings
> 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread kaputtnik
Thanks for explanation.

I have used now blue and white instead of red and completed the example. In 
r8443 i have changed both code examples accordingly. In r8444 i have removed 
the code example from wlrichtext and linked the example in richtext.lua. Feel 
free to revert this change, but one example is better for maintenance, imho.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-24 Thread GunChleoc
Thanks for the image! I have also changed the code example in the main article 
to match. The red is a bit glaring, maybe we can have different color, just 
toned down a bit? I also fixed a spelling error in the text contained in the 
image, so it needs rerendering anyway.

It doesn't matter whether we use "" or [[]] in Lua. [[]] is for multiline 
strings that will ignore newlines, but using those would make for weird strings 
presented to translators. https://www.lua.org/manual/5.3/manual.html#3.1
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-23 Thread kaputtnik
Ah forgotten: Not directly related to this branch but a question about the 
translation makro '_' and the use of brackets for strings instead of double 
quotation marks:

Does the _ only work with '_[[some text]]' and not with _"some text"?

The doc for _ (https://wl.widelands.org/docs/wl/autogen_globals/#_) says _"some 
text" can also be used.

Why are then all strings in the campaign files enclosed with brackets? Is there 
a benefit of using [[ ]] in comparison with using ""?
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-23 Thread kaputtnik
Changed the code example and the resulting image. I have tried also to explain 
in short what the '..' are used for. While a first reader may does not know 
what my explanation means exactly, one can search the web for the keyword.

Feel free to rephrase :-)
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-23 Thread GunChleoc
Thanks!

Maybe it would indeed be best if you created the examples - I am too close to 
this, so you know better what is needed here.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-23 Thread kaputtnik
I think this is better :-)

Maybe i have not explained enough about the code example for the attributes. 
The reason why i am so stubborn for a related code example is that it took me 
some time to fiddle out how to use them. E.g. it was unclear how to use values 
for an attribute.

I would suggest to change the code example in richtext.lua to something like:

--h1(_[[Header]]) ..
--p(_[[A Paragraph]]) ..
--p(_[[A Paragraph with ]] .. font("color=ff", _[[red text ]]) .. 
_[[and ]] .. font("italic=1", _[[italic formatted text.]])) ..
-- and so on

No idea if this code will ever work :-D But hopefully it shows what kind of 
code example i miss. I could add such an example with a related image, if you 
don't want to do the additional work to create such an image. May i could test 
then also if i have understand all the things ;)

I have found some misspelling, will do a complete proof reading this weekend.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-22 Thread GunChleoc
All done.

For code examples, I just linked back to the main code example. Is this OK for 
now? Some of the attributes are still a bit WIP.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-22 Thread kaputtnik
Good work :-)

The grouping into headers is nice. A user can find the things he needs much 
better. There is one exception though: The rt tags documentation contain too 
much headers, imho. E.g for  there are headers 'Attributes', 'Padding', 
'Background Color' and 'Global Formatting Controls'. While the subheaders are a 
bit smaller it's nevertheless confusing. I think it would be better to have all 
attributes in one list. The attributes names are quite self explaining, imho. 
Same goes for the  tag. Just like it is for the  tag: One header 
'Attributes' and a list of all attributes.

I miss an example how to use the attributes.

I am unsure about tags with no attributes or no subtags. I think we could omit 
the headers if there are no entries in it. A reader can imho understand if 
there is nothing documented, there are no attributes or subtags possible.

Added also two diff comments.

Diff comments:

> 
> === modified file 'data/scripting/richtext.lua'
> --- data/scripting/richtext.lua   2018-02-12 10:17:22 +
> +++ data/scripting/richtext.lua   2018-02-22 07:28:23 +
> @@ -8,53 +11,30 @@
>  -- Most of these functions are simple wrapper functions that make working 
> with
>  -- widelands rich text formatting system more bearable.

Add the link to the widelands richtext system form below to the above?

>From my understanding you can give a link also another title using syntax: 
>:ref:`Link title `

>  -- Function names generally follow HTML names.
> +-- We strongly recommend that you make use of these functions rather than 
> hacking
> +-- the tags manually.
> +-- See also :ref:`wlrichtext` for an introduction to the richtext system and 
> a code example.

A reader should not 'See also' if it is not recommended. Move the link to above 
and omit the sentence?

> +-- If you're writing a scenario, you should also have a look at
> +-- :ref:`richtext_scenarios.lua`.
> +--
> +-- - `Blocks and Positioning`_
> +-- - `Headings and Paragraphs`_
> +-- - `Text Formatting`_
> +-- - `Lists`_
> +-- - `Images`_
> +-- - `Links`_
> +-- - `Text Composition`_
>  
>  
>  -- RST
> --- .. function:: localize_list(items, listtype, former_textdomain)
> ---:noindex:
> ---
> ---Turns an array of string items into a localized string list with
> ---appropriate concatenation.
> ---
> ---e.g. localize_list({"foo", "bar", baz"}, "or", "widelands") will return
> ---_"foo, bar or baz"
> ---
> ---:arg items:  An array of strings
> ---:arg listtype:   The type of concatenation to use.
> --- Legal values are "&", "and", "or", and ";"
> ---:arg former_textdomain:  The textdomain to restore after running this 
> function.
> ---:returns: The concatenated list string, using localized concatenation 
> operators.
> ---
> --- Same algorithm as in src/base/i18n
> -function localize_list(items, listtype, former_textdomain)
> -   set_textdomain("widelands")
> -   local result = ""
> -   for i, item in pairs(items) do
> -  if (i == 1) then
> - result = item
> -  elseif (i == #items) then
> - if (listtype == "&") then
> -result = _"%1$s & %2$s":bformat(result, item)
> - elseif (listtype == "or") then
> -result = _"%1$s or %2$s":bformat(result, item)
> - elseif (listtype == ",") then
> -result = _"%1$s, %2$s":bformat(result, item)
> - else
> -result = _"%1$s and %2$s":bformat(result, item)
> -  end
> -  else
> - result = _"%1$s, %2$s":bformat(result, item)
> -  end
> -   end
> -   set_textdomain(former_textdomain)
> -   return result
> -end
> +-- Blocks and Positioning
> +-- ^^
> +--
> +-- This section covers functions for structuring your text layout.
>  
>  
>  -- RST
>  -- .. function:: rt(text_or_attributes[, text = nil])
> ---:noindex:
>  --
>  --Wraps a block of text into Lua rich text.
>  --Only call this once for the whole text that gets sent to the backend.


-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-21 Thread GunChleoc
Review: Resubmit

Should be done now. I have also reorganized the document into sections.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-documentation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-21 Thread kaputtnik
I think this is good now. For the first time it is confusing that we have 
functions and the '<>' tags when switching between the pages. It's unclear 
where one has landet after clicking the link to attributes. Maybe write it in 
another way?

Instead:
attributes (string) – the attributes for the img tag.

Something like:
attributes (string) – see the rt-tags documentation for the attributes 
#attributes is the link


-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-21 Thread GunChleoc
I have now rewritten the main article and added a table of contents to it. I 
have also hooked up the attributes documentation for 2 tags. Before I continue 
with those, what do you think?

I also think that I should reorganize the richtext.lua script so that we can 
divide the documentation into logical sections for easier reading.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-19 Thread GunChleoc
Sorry, I'm seeing it now, you just edited them. Duh.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-18 Thread kaputtnik
> But you did add some

Ok, i correct my self: I did not add any documentation which were in two places:

> Hm, we now have the allowed attributes documented in 2 places.

The allowed attributes were already at 2 places in the documentation, before i 
edited the RST comments. My fault that i didn't mention this. But please don't 
make me feel guilty for things i haven't done :-)
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-15 Thread GunChleoc
But you did add some, in this commit: 
https://bazaar.launchpad.net/~widelands-dev/widelands/fh1-documentation/revision/8429

It would be better to link to the allowed attributes documentation in 
src/graphic/text/rt_parse.cc and not duplicate the documentation in the Lua 
file.

I also still need to rewrite the main Richtext document 
https://wl.widelands.org/docs/wl/wlrichtext/ and link everything together in a 
tree.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-13 Thread kaputtnik
I didn't add any documenation ;)

Double documentation is not good. What about having the richtext documentation 
in the cpp file and parse it like we have for src/scripting/lua_bases.cpp? -> 
https://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/doc/sphinx/extract_rst.py#L18

The real problem is that we have two different document generators with 
different syntax: doxygen and sphinx. So making documentation for one of them 
means it does not work with the other one. I'ts also bad for devolpers, because 
they have to use two different syntaxes for the source code documentation. 
Sphinx is also capable to document c++ code, imho: 
http://www.sphinx-doc.org/en/stable/domains.html#id2 In the long term run there 
should only be one source code documentation generator, imho.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-13 Thread GunChleoc
Hm, we now have the allowed attributes documented in 2 places. The reason that 
I documented them in the C++ code is to be close to the code, so that we won't 
forget to update the documentation when they change. We can pretty much 
guarantee that updating the documentation in richtext.lua will be forgotten 
eventually.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-12 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3173. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/340643220.
Appveyor build 2980. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_documentation-2980.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-12 Thread kaputtnik
Took the freedom to adjust the RST parts. Mainly:

- make lists of allowed attributes a bulleted list (i think this was intended)
- fixed some args
- fixed indentation to have it consistent over the pages
- added the function definition of new_objectives() in richtext_scenarios.lua
- added some links in the text

For the allowed attributes it would be nice to have a description how to use 
them. Something like 

Attributes have to be applied as a string in form of "attribute1=value1 
attribute2=value2": E.g. font("color=ff italic=1", text)

Don't know were to put such an example though.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-12 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3168. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/340441956.
Appveyor build 2975. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_documentation-2975.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-12 Thread GunChleoc
The send_to_all function change is from 
https://code.launchpad.net/~widelands-dev/widelands/fh1-maps-multiplayer/+merge/337506,
 so that branch needs to be merged first.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-12 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/fh1-documentation into 
lp:widelands has been updated.

Commit Message changed to:

Documented tag constraints for new font renderer

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-documentation into lp:widelands

2018-02-12 Thread GunChleoc
GunChleoc has proposed merging lp:~widelands-dev/widelands/fh1-documentation 
into lp:widelands.

Commit message:
Updated documentation for new font renderer

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fh1-documentation/+merge/337545
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-documentation into lp:widelands.
=== modified file 'data/scripting/messages.lua'
--- data/scripting/messages.lua	2017-12-09 06:29:26 +
+++ data/scripting/messages.lua	2018-02-12 10:29:06 +
@@ -33,6 +33,28 @@
player:send_message(title, body, parameters)
 end
 
+
+-- RST
+-- .. function:: send_to_all(text[, heading])
+--
+--Sends a game status message to all players.
+--
+--:arg text: the localized body of the message. You can use rt functions here.
+--:type text: :class:`string`
+--:arg heading: the localized title of the message (optional)
+--:type heading: :class:`string`
+--
+function send_to_all(text, heading)
+   for idx,plr in ipairs(game.players) do
+  if (heading ~= nil and heading ~= "") then
+ send_message(plr, _"Status", text, {popup=true, heading=heading})
+  else
+ send_message(plr, _"Status", text, {popup=true})
+  end
+   end
+end
+
+
 -- RST
 -- .. function:: message_box(player, title, message, parameters)
 --

=== modified file 'data/scripting/richtext.lua'
--- data/scripting/richtext.lua	2018-01-16 19:46:20 +
+++ data/scripting/richtext.lua	2018-02-12 10:29:06 +
@@ -12,7 +12,6 @@
 
 -- RST
 -- .. function:: localize_list(items, listtype, former_textdomain)
---:noindex:
 --
 --Turns an array of string items into a localized string list with
 --appropriate concatenation.
@@ -54,7 +53,6 @@
 
 -- RST
 -- .. function:: rt(text_or_attributes[, text = nil])
---:noindex:
 --
 --Wraps a block of text into Lua rich text.
 --Only call this once for the whole text that gets sent to the backend.
@@ -85,7 +83,6 @@
 
 -- RST
 -- .. function:: img(src[, attributes = nil])
---:noindex:
 --
 --Turns an image src path into an image tag for richtext.
 --
@@ -116,7 +113,6 @@
 
 -- RST
 -- .. function:: h1(text_or_color[, text = nil])
---:noindex:
 --
 --Returns a paragraph formatted as a big heading with a small gap after it.
 --The mnemonic comes from HTML.
@@ -132,7 +128,6 @@
 
 -- RST
 -- .. function:: h2(text)
---:noindex:
 --
 --Like :func:`h1` but smaller.
 --
@@ -143,7 +138,6 @@
 
 -- RST
 -- .. function:: h3(text)
---:noindex:
 --
 --Like :func:`h2` but smaller.
 --
@@ -155,7 +149,6 @@
 
 -- RST
 -- .. function:: h4(text)
---:noindex:
 --
 --Like :func:`h3` but smaller.
 --
@@ -167,7 +160,6 @@
 
 -- RST
 -- .. function:: p(text_or_attributes[, text = nil])
---:noindex:
 --
 --Returns one paragraph with text followed by a small vertical gap. Options
 --can be given as first argument similar to :func:`rt`.
@@ -283,7 +275,6 @@
 
 -- RST
 -- .. function:: dl(dt, dd)
---:noindex:
 --
 -- This function imitates a HTML description list
 --:arg dt: "description term", will be rendered in bold.
@@ -349,7 +340,6 @@
 
 -- RST
 -- .. function:: a(link)
---:noindex:
 --
 -- This function imitates a HTML link. We can't do real links yet, so the text just gets underlines.
 --:arg link: the text to format
@@ -362,7 +352,6 @@
 
 -- RST
 -- .. function:: b(link)
---:noindex:
 --
 -- This makes the text bold.
 --:arg link: the text to format
@@ -375,7 +364,6 @@
 
 -- RST
 -- .. function:: i(link)
---:noindex:
 --
 -- This makes the text italic.
 --:arg link: the text to format

=== modified file 'doc/sphinx/extract_rst.py'
--- doc/sphinx/extract_rst.py	2017-11-05 09:30:44 +
+++ doc/sphinx/extract_rst.py	2018-02-12 10:29:06 +
@@ -14,6 +14,7 @@
 # Meaning: (src_file, file_name_to_generate_rst)
 cpp_pairs = (
 ('src/ai/ai_hints.cc', 'autogen_ai_hints.rst'),
+('src/graphic/text/rt_parse.cc', 'autogen_rt_tags.rst'),
 ('src/scripting/lua_root.cc', 'autogen_wl.rst'),
 ('src/scripting/lua_bases.cc', 'autogen_wl_bases.rst'),
 ('src/scripting/lua_editor.cc', 'autogen_wl_editor.rst'),

=== modified file 'doc/sphinx/source/lua_index.rst'
--- doc/sphinx/source/lua_index.rst	2012-06-20 09:07:10 +
+++ doc/sphinx/source/lua_index.rst	2018-02-12 10:29:06 +
@@ -10,5 +10,6 @@
tutorial
reference
roadmap
+   autogen_rt_tags
wlrichtext
implementation

=== modified file 'src/graphic/text/rt_parse.cc'
--- src/graphic/text/rt_parse.cc	2017-12-09 06:29:26 +
+++ src/graphic/text/rt_parse.cc	2018-02-12 10:29:06 +
@@ -171,11 +171,71 @@
 	}
 }
 
+/* RST
+.. _rt_tags:
+
+The Richtext Tags
+=
+
+- :ref:`rt_tags_br`
+- :ref:`rt_tags_div`
+- :ref:`rt_tags_font`
+- :ref:`rt_tags_img`
+- :ref:`rt_tags_p`
+- :ref:`rt_