Bug 163747 - API documentation: "published" decoration needs an "unpublished" counterpart
Summary: API documentation: "published" decoration needs an "unpublished" counterpart
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Buovjaga
URL:
Whiteboard: target:26.2.0 target:25.8.0.0.beta2
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-03 10:49 UTC by Mike Kaganski
Modified: 2025-07-02 10:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-11-03 10:49:20 UTC
Ref: https://ask.libreoffice.org/t/how-can-i-find-out-about-xselectsheetsupplier-or-what-methods-will-return-an-object-type/103621

The "published" decoration in the SDK documentation, that marks the interfaces / enums / services / whatever, that are actually intended for use by user, lacks its counterpart - like "unpublished" or "internal". For a user, who opened a given documentation page, where there's no "published" decoration, there's no indication that this documented interface shouldn't be used in scripts. How would one magically get that knowledge? And so, it is natural, that people will use the unpublished parts of the API, and then suffer from breakage. It must be expressed explicitly, and preferably not only with a short one-word decoration, but also with some explanation, like "may change in a future version without notice", or some such.
Comment 1 Michael Weghorn 2025-05-22 08:59:37 UTC
+1

Qt for example has this in its private headers:

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
Comment 2 Mike Kaganski 2025-06-17 04:49:40 UTC
Ilmari: can we use '.not()' CSS selector [1] for this?

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/:not
Comment 3 Buovjaga 2025-06-17 06:34:54 UTC
(In reply to Mike Kaganski from comment #2)
> Ilmari: can we use '.not()' CSS selector [1] for this?
> 
> [1] https://developer.mozilla.org/en-US/docs/Web/CSS/:not

There is a glorious hack we might use, copying all the label styles and applying them to an ::after pseudo element, which also accepts arbitrary text content:

.title:not(:has(> .mlabels))::after {
  content: "unpublished";
  margin-left: 8px;
  background-color: #728DC1;
  border-top: 1px solid #5373B4;
  border-left: 1px solid #5373B4;
  border-right: 1px solid #C4CFE5;
  border-bottom: 1px solid #C4CFE5;
  text-shadow: none;
  color: white;
  margin-right: 4px;
  padding: 2px 3px;
  border-radius: 3px;
  font-size: 7pt;
  white-space: nowrap;
  vertical-align: middle;
}

However, this is made brittle by Doxygen's too generic approach to the labels: it doesn't use a class name for "published". CSS does not have a way to check "does the element have text content matching x". So if our docs contain any other labels besides "published" the hack is not reliable. If "published" is the only label, though, then everything will be fine.
Comment 4 Mike Kaganski 2025-06-17 06:41:22 UTC
(In reply to Buovjaga from comment #3)

I would say: it's worth it to try.
Comment 5 Buovjaga 2025-06-17 07:19:39 UTC
Hopefully it works: https://gerrit.libreoffice.org/c/core/+/186595
Comment 6 Buovjaga 2025-06-17 14:43:10 UTC
(In reply to Buovjaga from comment #5)
> Hopefully it works: https://gerrit.libreoffice.org/c/core/+/186595

Doesn't work.
Comment 7 Commit Notification 2025-07-01 18:22:19 UTC
Ilmari Lauhakangas committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ddf77c92a59080f12603c1ecb5ea254a89a654d3

tdf#163747 ODK docs: CSS hack to add "unpublished" decoration

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2025-07-02 10:08:39 UTC
Ilmari Lauhakangas committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/d80c715c78e0b189344a272ab19478fc0f79f594

tdf#163747 ODK docs: CSS hack to add "unpublished" decoration

It will be available in 25.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.