Template talk:lc
From cppreference.com
Autolinker definitions are out of sync for other languages
Currently the latest update for the English versions of MediaWiki:autolinker-definition-c and MediaWiki:autolinker-definition-cpp were in 2021, while other languages are using older versions (such as zh:MediaWiki:autolinker-definition-cpp, the latest update is in 2018). Xmcgcg (talk) 18:31, 13 April 2023 (PDT)
- Maybe, the general plan should be:
- Complete most (if not all) C++23/C23 pages, so all necessary identifiers are available together with target pages.
- Gather these new names to their appropriate lists.
- Propagate the change to non-English sub-sites.
- How about that? :-) --Space Mission (talk) 14:46, 16 April 2023 (PDT)
- I agree, but I suggest the current versions of MediaWiki:autolinker-definition-c and MediaWiki:autolinker-definition-cpp can be applied to non-English sub-sites first. The reason I created the {{ltt std}} template family is to resemble the behavior of {{lc}} in some non-English pages. We can make {{lc}} behave consistently across the sub-sites before the next versions are ready.
- And there is another question: how is the link to
boolean-testablecreated? I cannot find it in MediaWiki:autolinker-definition-cpp, but the link to it can be created in the declarations in the pageequality_comparable. Xmcgcg (talk) 19:40, 16 April 2023 (PDT)
- And there is another question: how is the link to
- Ah. There are two subsystems of MediaWiki engine that are responsible for auto-linking. The first one is for links in text, used by the templates like {{lc}} and borrowing the links from MediaWiki:autolinker-definition-cpp family.
- The second subsystem generates auto-links for source code (in {{source}}/{{example}}) and uses MediaWiki:Geshi-keyword-list-cpp etc as its database (MediaWiki:Geshi-keyword-list-c for C). The
boolean-testableand the like are of this "Geshi-keyword-list" kind. Such "special-treatment-identifiers" (that appear in code blocks in bold-italic) are collected at the head of this list.
- The second subsystem generates auto-links for source code (in {{source}}/{{example}}) and uses MediaWiki:Geshi-keyword-list-cpp etc as its database (MediaWiki:Geshi-keyword-list-c for C). The
- BTW, there might be much more exposition-only italicized identifiers in that list (alongside with
boolean-testable), but such identifiers (with'-'inside}} do not play well with MediaWiki's internal C++-parser, as can be noticed examining the synopsis of std::uninitialized_fill page, where no-throw-sentinel-for is broken since the parser threats this sequence as a list of identifiers/keywords (e.g.,forin this case) separated by a minus sign. Maybe, the/*no-throw-sentinel-for*/sequence should be used (in the list) instead? Or "normal" C++ ids in some form:__no_throw_sentinel_for/___No__Throw__Sentinel__For___.)
- BTW, there might be much more exposition-only italicized identifiers in that list (alongside with
- You may find more info in discussion page and linked archived pages, and in an "unofficial doc".
- --Space Mission (talk) 05:15, 17 April 2023 (PDT)
- I see. The non-English versions of MediaWiki:Geshi-keyword-list-cpp and MediaWiki:Geshi-keyword-list-c are also falling behind, probably need to be updated together with the autoliner definition files. I will create a page of exposition-only name list later (with a link to it in std symbol page) as the to-do list.
- The no-throw-sentinel-for problem has a workaround: use the Script Small O (
ℴ), it is italic, so mixing it with other ASCII letters in italic teletype font looks good (ooo(ordinary 'o') VSℴℴℴ(small script 'o'). Xmcgcg (talk) 19:38, 17 April 2023 (PDT)
- The no-throw-sentinel-for problem has a workaround: use the Script Small O (
- Hmm, why then not with the "Non-Breaking Hyphen"? E.g.
no-throw-sentinel-for(with ordinary hyphen'-') vsno‑throw‑sentinel‑for(with non-breaking hyphen'‑').
- --Space Mission (talk) 00:49, 18 April 2023 (PDT)
- Hmm, why then not with the "Non-Breaking Hyphen"? E.g.
- Unfortunately (?), U+2011 does not have the Unicode property
XID_Continueeither (see [1]), so using NB hyphen is highly unlikely to work.
- Unfortunately (?), U+2011 does not have the Unicode property
- BTW, the problem is certainly with trailing 'for' that is parsed as keyword, e.g.:
no-throw-sentinel-for
test-throw- // - not highlighted
test-throw // + highlighted as keyword
test-for- // - not highlighted
test-for // + highlighted as keyword
- So, if 'throw' was the trailing word, the whole identifier would be "broken" for GeSHi.
- As to the small-o, did you mean
no-throw-sentinel-fℴr? This looks inaccessible in some fonts :/ - What about siblings of o in other alphabets, e.g., о (U+043E, has XID_Continue prop.) (inside
fоr⇒no-throw-sentinel-fоr) and as round as Latin U+006F o?. --Space Mission (talk) 16:34, 15 June 2023 (PDT)
Template bug?
As can be seen on Fixed width integer types, under some sections such as "Signed integers : maximum value" and "Unsigned integers : maximum value", the uses of {{lc}} renders the names in bold. The rest of the page uses {{c/core}} instead, likely to avoid it, which "isn't intended to be directly used". Is this a styling bug? --Studyingegret (talk)
- ✔ Done This is apparently an oversight. It's fixed now, I hope.
- Besides, that property of {{lc}} to be rendered in bold if the link's target is on the same page seems like an obsolete "feature", that probably should eventually be changed: from {{ttb}} to plain {{tt}}. (?) --Space Mission (talk) 14:38, 16 April 2023 (PDT)