Git commit 3563a4dfd440f41320ae349ad6e6d1ed49f49b00 by Akseli Lahtinen. Committed on 29/08/2025 at 16:53. Pushed by akselmo into branch 'master'.
Remove help-page, use docbook instead Instead of using specific help-page, create a docbook and use that instead. M +1 -0 .kde-ci.yml M +4 -1 CMakeLists.txt A +5 -0 doc/CMakeLists.txt A +8 -0 doc/komodo/CMakeLists.txt A +271 -0 doc/komodo/index.docbook M +0 -28 src/Main.qml M +0 -1 src/ui/CMakeLists.txt D +0 -79 src/ui/KomoDoHelp.qml M +1 -1 src/ui/TodoPage.qml https://invent.kde.org/utilities/komodo/-/commit/3563a4dfd440f41320ae349ad6e6d1ed49f49b00 diff --git a/.kde-ci.yml b/.kde-ci.yml index c8ad01d..a3b5940 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -16,3 +16,4 @@ Dependencies: 'frameworks/kguiaddons': '@latest-kf6' 'frameworks/kcolorscheme': '@latest-kf6' 'frameworks/kdbusaddons': '@latest-kf6' + 'frameworks/kdoctools': '@latest-kf6' diff --git a/CMakeLists.txt b/CMakeLists.txt index 5348dfc..e15bc9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ ecm_setup_version(PROJECT ) find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Widgets) -find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS ColorScheme Kirigami CoreAddons Config I18n ItemModels QQC2DesktopStyle GuiAddons IconThemes) +find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS ColorScheme Kirigami CoreAddons Config I18n ItemModels QQC2DesktopStyle GuiAddons IconThemes DocTools) set(USE_DBUS OFF) if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU) @@ -58,7 +58,10 @@ feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) +add_subdirectory(doc) + ki18n_install(po) +kdoctools_install(po) ecm_qt_install_logging_categories( EXPORT ${CMAKE_PROJECT_NAME}_EXPORT diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..f4053fe --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2025 Akseli Lahtinen <akse...@akselmo.dev> +# SPDX-License-Identifier: BSD-2-Clause + +find_package(KF6DocTools ${KF6_DEP_VERSION} QUIET) +add_subdirectory(komodo) diff --git a/doc/komodo/CMakeLists.txt b/doc/komodo/CMakeLists.txt new file mode 100644 index 0000000..b1704e8 --- /dev/null +++ b/doc/komodo/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2025 Akseli Lahtinen <akse...@akselmo.dev> +# SPDX-License-Identifier: BSD-2-Clause + +kdoctools_create_handbook( + index.docbook + INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en + SUBDIR komodo +) diff --git a/doc/komodo/index.docbook b/doc/komodo/index.docbook new file mode 100644 index 0000000..487518c --- /dev/null +++ b/doc/komodo/index.docbook @@ -0,0 +1,271 @@ +<?xml version="1.0" ?> +<!-- +SPDX-FileCopyrightText: 2025 Akseli Lahtinen <akse...@akselmo.dev> +SPDX-License-Identifier: CC-BY-SA-4.0 +--> +<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [ + <!ENTITY komodo "<application>KomoDo</application>"> + <!ENTITY i18n-translatable-entity "<application>Translatable Entity</application>"> + <!ENTITY % addindex "IGNORE"> + <!ENTITY % English "INCLUDE"> + <!ENTITY Akseli.Lahtinen "<personname><firstname>Akseli</firstname><surname>Lahtinen</surname></personname>"> + <!ENTITY Akseli.Lahtinen.mail "<email>akse...@akselmo.dev</email>"> +]> +<book id="komodo" lang="&language;"> +<bookinfo> +<title>The &komodo; Handbook</title> +<authorgroup> +<author>&Akseli.Lahtinen; &Akseli.Lahtinen.mail;</author> +<!-- TRANS:ROLES_OF_TRANSLATORS --> +</authorgroup> +<copyright> +<year>2025</year> +<holder>Akseli Lahtinen</holder> +</copyright> +<legalnotice>&CCBYSA4Notice;</legalnotice> +<date>2025-08-29</date> +<releaseinfo>KomoDo 1.0</releaseinfo> +<abstract> +<para> +KomoDo is a todo manager that uses todo.txt specification. It parses any compliant todo.txt files and turns them into easy to use list of tasks. +</para> +</abstract> +<keywordset> +<keyword>KDE</keyword> +<keyword>kdeutils</keyword> +<keyword>kde</keyword> +<keyword>utilities</keyword> +<keyword>todos</keyword> +<keyword>komodo</keyword> +</keywordset> +</bookinfo> + +<chapter id="introduction"> +<title>KomoDo and Todo.txt</title> +<para> +<ulink url="http://todotxt.org/">todo.txt</ulink> is a really simple +task management method, that follows strict but small set of rules. +</para> +<para> +The first and most important rule of todo.txt is: A single line +in your todo.txt text file represents a single task. +</para> +<para> +KomoDo parses those lines from your todo.txt file, and showcases +them as their own cards. It aims to show you all the information +about your tasks. +</para> +</chapter> + +<chapter id="basic-syntax"> +<title>Basic Syntax</title> +<para> +Here is a task with all the items. Items are divided by space and +symbols. The items must always be in this order. +</para> +<sect1 id="task-creation"> +<title>Task Creation</title> +<para> +During task creation, syntax will be something like this: +</para> +<para> +<replaceable>(A) 2024-10-23 Do this task for +KomoDoApp @Akademy due:2025-12-10 link:https://kde.org</replaceable> +</para> +<para> +Here is the explanation for the items: +</para> +<informaltable> +<tgroup cols="2"> +<thead> +<row> +<entry> +Item +</entry> +<entry> +Description +</entry> +</row> +</thead> +<tbody> +<row> +<entry> +(A) +</entry> +<entry> +Priority of the item, from A to Z. Optional. Will be +removed and turned into pri:A when task is completed. +</entry> +</row> +<row> +<entry> +2024-10-23 +</entry> +<entry> +Creation date. Optional, but recommended. +</entry> +</row> +<row> +<entry> +Do this task for +KomoDoApp @Akademy +</entry> +<entry> +The description of the task. Projects and contexts can be +marked anywhere within the description. +</entry> +</row> +<row> +<entry> ++project +</entry> +<entry> +Items starting with + are projects: What project is this +task related to? For example: +Application, +Linux. +Optional. +</entry> +</row> +<row> +<entry> +@context +</entry> +<entry> +Items starting with @ are contexts: In what context +(place, situation) should this task be worked with? For +example: @Home, @Work, @Cafe. Optional. +</entry> +</row> +<row> +<entry> +key:value +</entry> +<entry> +Key:Value pairs that will be parsed by KomoDo. Can be used +for links, such as link:https://kde.org. Optional. +</entry> +</row> +<row> +<entry> +due:2025-12-10 +</entry> +<entry> +Special Key:Value pair that KomoDo parses as a due date +for the task. It only supports date, not time. Optional. +</entry> +</row> +</tbody> +</tgroup> +</informaltable> +<sect2 id="task-completion"> +<title>Task Completion</title> +<para> +When task is marked as completed, KomoDo will format the task like +this: +</para> +<para> +<replaceable>x 2025-12-30 2024-10-23 Do this task for +KomoDoApp @Akademy due:2025-12-10 link:https://kde.org pri:A</replaceable> +</para> +<para> +Most items stay the same, but there are couple changes: +</para> +<informaltable> +<tgroup cols="2"> +<thead> +<row> +<entry> +Item +</entry> +<entry> +Description +</entry> +</row> +</thead> +<tbody> +<row> +<entry> +x +</entry> +<entry> +This marks the completion. If there is no x, task is +incomplete. Must be lowercase. +</entry> +</row> +<row> +<entry> +2025-12-30 +</entry> +<entry> +First date is completion date, but only if the task is +marked as completed. Optional, but recommended. +</entry> +</row> +<row> +<entry> +2024-10-23 +</entry> +<entry> +Second date is the creation date. Must be specified if the +completion date is! +</entry> +</row> +<row> +<entry> +pri:A +</entry> +<entry> +Priorities of completed tasks will be removed from start +and appended into the end of task as pri:Priority. +</entry> +</row> +</tbody> +</tgroup> +</informaltable> +</sect2> +</sect1> +</chapter> + +<chapter id="what-komodo-does"> +<title>What KomoDo does</title> +<para> +You should not need to worry much about the syntax, except when +creating tasks. KomoDo will try to take care of the rest for you, +such as updating the completion dates. +</para> +<para> +You can add as much or as little detail to your tasks, and KomoDo +will do it’s best to visualize it for you. KomoDo also has filtering +tools for searching tasks. +</para> +<para> +You can then also open this same file in any text editor or other +todo.txt applications. +</para> +<para> +Please see the following link for for more information and the official +todo.txt specification: +<ulink url="https://github.com/todotxt/todo.txt/blob/master/README.md">Syntax Source Material</ulink> +</para> +</chapter> + +<chapter id="credits"> +<title>Credits and License</title> +<para>Documentation Copyright © &Akseli.Lahtinen; &Akseli.Lahtinen.mail;</para> +<!-- TRANS:CREDIT_FOR_TRANSLATORS --> +&underCCBYSA4; +<!-- CC BY-SA 4.0: do not remove --> +&underGPL; +<!-- GPL License --> +</chapter> + +&documentation.index; + +</book> +<!-- +Local Variables: +mode: sgml +sgml-namecase-general: t +sgml-namecase-entity: nil +sgml-general-insert-case: lower +sgml-minimize-attributes: nil +sgml-omittag: nil +End: +--> + diff --git a/src/Main.qml b/src/Main.qml index f724a86..ca545b1 100644 --- a/src/Main.qml +++ b/src/Main.qml @@ -34,33 +34,5 @@ Kirigami.ApplicationWindow { } } - Component { - id: helpPage - Kirigami.ScrollablePage { - visible: false - title: i18n("KomoDo Help") - ColumnLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.margins: Kirigami.Units.smallSpacing - KomoDoHelp { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: Kirigami.Units.gridUnit * 20 - wrapMode: Text.Wrap - } - - Kirigami.UrlButton { - text: i18nc("@info", "Syntax Source Material") - url: "https://github.com/todotxt/todo.txt/blob/master/README.md" - } - - Item { - implicitHeight: Kirigami.Units.gridUnit * 2 - } - } - } - } - pageStack.initialPage: TodoPage {} } diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index c5ca444..838e615 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -16,5 +16,4 @@ ecm_target_qml_sources(${CMAKE_PROJECT_NAME}_ui SOURCES TodoPage.qml TodoDelegate.qml - KomoDoHelp.qml ) diff --git a/src/ui/KomoDoHelp.qml b/src/ui/KomoDoHelp.qml deleted file mode 100644 index 05787ee..0000000 --- a/src/ui/KomoDoHelp.qml +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-FileCopyrightText: 2025 Akseli Lahtinen <akse...@akselmo.dev> -// SPDX-License-Identifier: GPL-2.0-or-later - -import QtQuick -import QtQuick.Layouts -import org.kde.kirigami as Kirigami - -Kirigami.SelectableLabel { - id: helpText - textFormat: Text.MarkdownText - text: i18nc("KomoDo help text, keep the markdown formatting", ` - -# KomoDo and Todo.txt - -[todo.txt](http://todotxt.org/) is a really simple task management method, -that follows strict but small set of rules. - -The first and most important rule of todo.txt is: -> A single line in your todo.txt text file represents a single task. - -KomoDo parses those lines from your todo.txt file, -and showcases them as their own cards. It aims to show you all the -information about your tasks. - -# Basic Syntax - -Here is a task with all the items. Items are divided by space and symbols. -The items must always be in this order. - -## Task Creation - -During task creation, syntax will be something like this: - - (A) 2024-10-23 Do this task for +KomoDoApp @Akademy due:2025-12-10 link:https://kde.org - -Here is the explanation for the items: - -| Item | Description | -|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| -| (A) | Priority of the item, from A to Z. Optional. Will be removed and turned into pri:A when task is completed. | -| 2024-10-23 | Creation date. Optional, but recommended. | -| Do this task for +KomoDoApp @Akademy | The description of the task. Projects and contexts can be marked anywhere within the description. | -| +project | Items starting with + are projects: What project is this task related to? For example: +Application, +Linux. Optional. | -| @context | Items starting with @ are contexts: In what context (place, situation) should this task be worked with? For example: @Home, @Work, @Cafe. Optional. | -| key:value | Key:Value pairs that will be parsed by KomoDo. Can be used for links, such as link:https://kde.org. Optional. | -| due:2025-12-10 | Special Key:Value pair that KomoDo parses as a due date for the task. It only supports date, not time. Optional. | - -When task is marked as completed, KomoDo will format the task like this: - - x 2025-12-30 2024-10-23 Do this task for +KomoDoApp @Akademy due:2025-12-10 link:https://kde.org pri:A - -## Task Completion - -Most items stay the same, but there are couple changes: - -| Item | Description | -|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| -| x | This marks the completion. If there is no x, task is incomplete. Must be lowercase. | -| 2025-12-30 | First date is completion date, but only if the task is marked as completed. Optional, but recommended. | -| 2024-10-23 | Second date is the creation date. Must be specified if the completion date is! | -| pri:A | Priorities of completed tasks will be removed from start and appended into the end of task as pri:Priority. | - -# What KomoDo does - -You should not need to worry much about the above, except when creating tasks. -KomoDo will try to take care of the rest for you, such as updating the completion dates. - -You can add as much or as little detail to your tasks, and KomoDo will do it's best to visualize it for you. -KomoDo also has filtering tools for searching tasks. - -You can then also open this same file in any text editor or other todo.txt applications. - -Please see the link below for more information and the official todo.txt specification. - -`) - onLinkActivated: link => { - Qt.openUrlExternally(link); - } -} diff --git a/src/ui/TodoPage.qml b/src/ui/TodoPage.qml index cb3f0f7..c8a7cf2 100644 --- a/src/ui/TodoPage.qml +++ b/src/ui/TodoPage.qml @@ -261,7 +261,7 @@ Kirigami.ScrollablePage { Kirigami.Action { text: i18nc("@action:inmenu", "Help…") icon.name: "help-contents-symbolic" - onTriggered: pageStack.layers.push(helpPage) + onTriggered: Qt.openUrlExternally("help:/komodo") enabled: pageStack.layers.depth <= 1 shortcut: StandardKey.HelpContents },