mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:17:35 +00:00
Playground: Add help documentation
This commit is contained in:
parent
1e4b9a9cd9
commit
1f03b6ad57
4 changed files with 70 additions and 1 deletions
28
Base/usr/share/man/man1/Playground.md
Normal file
28
Base/usr/share/man/man1/Playground.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
## Name
|
||||||
|
|
||||||
|
Playground - GUI Markup Language (GML) editor
|
||||||
|
|
||||||
|
## Synopsis
|
||||||
|
|
||||||
|
```**sh
|
||||||
|
$ Playground
|
||||||
|
```
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
Playground facilitates development of graphical user interfaces (GUI)
|
||||||
|
for Serenity applications using GUI Markup Language (GML) to compose
|
||||||
|
a layout for GUI widgets and set widget attributes.
|
||||||
|
|
||||||
|
The specified widgets are automatically rendered in a live preview
|
||||||
|
window, allowing rapid prototyping and development of application GUIs.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ Playground
|
||||||
|
```
|
||||||
|
|
||||||
|
## See also
|
||||||
|
|
||||||
|
* [`gml-format`(1)](../man1/gml-format.md) For automated GML formatting
|
23
Base/usr/share/man/man1/gml-format.md
Normal file
23
Base/usr/share/man/man1/gml-format.md
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
## Name
|
||||||
|
|
||||||
|
gml-format - automated GUI Markup Language (GML) formatter
|
||||||
|
|
||||||
|
## Synopsis
|
||||||
|
|
||||||
|
```**sh
|
||||||
|
$ gml-format [--inplace] [path...]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
`gml-format` formats GUI Markup Language (GML) files.
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
* `-i`, `--inplace`: Write formatted contents back to file rather than standard output
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ gml-format -i /home/anon/example.gml
|
||||||
|
```
|
|
@ -3,4 +3,4 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_app(Playground ICON app-playground)
|
serenity_app(Playground ICON app-playground)
|
||||||
target_link_libraries(Playground LibGUI)
|
target_link_libraries(Playground LibDesktop LibGUI)
|
||||||
|
|
|
@ -25,8 +25,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/QuickSort.h>
|
#include <AK/QuickSort.h>
|
||||||
|
#include <AK/URL.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
#include <LibCore/Property.h>
|
#include <LibCore/Property.h>
|
||||||
|
#include <LibDesktop/Launcher.h>
|
||||||
#include <LibGUI/AboutDialog.h>
|
#include <LibGUI/AboutDialog.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/AutocompleteProvider.h>
|
#include <LibGUI/AutocompleteProvider.h>
|
||||||
|
@ -231,6 +233,19 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto app = GUI::Application::construct(argc, argv);
|
auto app = GUI::Application::construct(argc, argv);
|
||||||
|
|
||||||
|
if (pledge("stdio thread shared_buffer accept rpath cpath wpath unix", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Desktop::Launcher::add_allowed_handler_with_only_specific_urls(
|
||||||
|
"/bin/Help",
|
||||||
|
{ URL::create_with_file_protocol("/usr/share/man/man1/Playground.md") })
|
||||||
|
|| !Desktop::Launcher::seal_allowlist()) {
|
||||||
|
warnln("Failed to set up allowed launch URLs");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (pledge("stdio thread shared_buffer accept rpath cpath wpath", nullptr) < 0) {
|
if (pledge("stdio thread shared_buffer accept rpath cpath wpath", nullptr) < 0) {
|
||||||
perror("pledge");
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -331,6 +346,9 @@ int main(int argc, char** argv)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
auto& help_menu = menubar->add_menu("Help");
|
auto& help_menu = menubar->add_menu("Help");
|
||||||
|
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
|
||||||
|
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Playground.md"), "/bin/Help");
|
||||||
|
}));
|
||||||
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
||||||
GUI::AboutDialog::show("GML Playground", app_icon.bitmap_for_size(32), window);
|
GUI::AboutDialog::show("GML Playground", app_icon.bitmap_for_size(32), window);
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue