Skip to content

Dantti/ghpages docs #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ on:
- docs/**
- mkdocs.yml

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
mkdocs:
runs-on: ubuntu-latest
Expand All @@ -22,16 +34,22 @@ jobs:
pip install --user mkdocs-material
pip install --user mkdocs-build-plantuml-plugin
- name: Deploy GitHub Pages
run: |
mkdocs build
git worktree add gh-pages gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../site/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force
run: mkdocs build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/

# Deployment job, what was uploaded to artifact
deploy:
needs: mkdocs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions docs/API/script/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Script
|bool|**[checked](#checked)**|
|string|**[iconPath](#iconPath)**|
|string|**[id](#id)**|
|array<[Shortcut](../script/shortcut.md)>|**[shortcuts](#shortcuts)**|
|array&lt;[Shortcut](../script/shortcut.md)>|**[shortcuts](#shortcuts)**|
|string|**[statusTip](#statusTip)**|
|string|**[toolTip](#toolTip)**|

Expand All @@ -31,7 +31,7 @@ This property holds the fileName for the icon of the action.

This property holds the id of the action.

#### <a name="shortcuts"></a>array<[Shortcut](../script/shortcut.md)> **shortcuts**
#### <a name="shortcuts"></a>array&lt;[Shortcut](../script/shortcut.md)> **shortcuts**

This property holds all the shortcuts associated with the action.

Expand Down
21 changes: 6 additions & 15 deletions docs/API/script/codedocument.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ Inherited properties: [TextDocument properties](../script/textdocument.md#proper
| | Name |
|-|-|
|[Symbol](../script/symbol.md) |**[findSymbol](#findSymbol)**(string name, int options = TextDocument.NoFindFlags)|
||**[followSymbol](#followSymbol)**()|
|string |**[hover](#hover)**()|
|array<[QueryMatch](../script/querymatch.md)> |**[query](#query)**(string query)|
|array&lt;[QueryMatch](../script/querymatch.md)> |**[query](#query)**(string query)|
|[QueryMatch](../script/querymatch.md) |**[queryFirst](#queryFirst)**(string query)|
|array<[QueryMatch](../script/querymatch.md)> |**[queryInRange](#queryInRange)**([RangeMark](../script/rangemark.md) range, string query)|
|array&lt;[QueryMatch](../script/querymatch.md)> |**[queryInRange](#queryInRange)**([RangeMark](../script/rangemark.md) range, string query)|
||**[selectSymbol](#selectSymbol)**(string name, int options = TextDocument.NoFindFlags)|
|[Symbol](../script/symbol.md) |**[symbolUnderCursor](#symbolUnderCursor)**()|
|array<[Symbol](../script/symbol.md)> |**[symbols](#symbols)**()|
|array&lt;[Symbol](../script/symbol.md)> |**[symbols](#symbols)**()|

Inherited methods: [TextDocument methods](../script/textdocument.md#methods)

Expand All @@ -49,20 +48,12 @@ Finds a symbol based on its `name`, using different find `options`.
Note that the returned `Symbol` pointer is only valid until the document it originates
from is deconstructed.

#### <a name="followSymbol"></a>**followSymbol**()

Follows the symbol under the cursor.

- Go to the declaration, if the symbol under cursor is a use
- Go to the declaration, if the symbol under cursor is a function definition
- Go to the definition, if the symbol under cursor is a function declaration

#### <a name="hover"></a>string **hover**()

Returns information about the symbol at the current cursor position.
The result of this call is a plain string that may be formatted in Markdown.

#### <a name="query"></a>array<[QueryMatch](../script/querymatch.md)> **query**(string query)
#### <a name="query"></a>array&lt;[QueryMatch](../script/querymatch.md)> **query**(string query)

Runs the given Tree-sitter `query` and returns the list of matches.

Expand All @@ -84,7 +75,7 @@ queries](https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matchin
Also see: [Tree-sitter in Knut](../../getting-started/treesitter.md)
Core::QueryMatchList CodeDocument::query(const QString &query)

#### <a name="queryInRange"></a>array<[QueryMatch](../script/querymatch.md)> **queryInRange**([RangeMark](../script/rangemark.md) range, string query)
#### <a name="queryInRange"></a>array&lt;[QueryMatch](../script/querymatch.md)> **queryInRange**([RangeMark](../script/rangemark.md) range, string query)

Searches for the given `query`, but only in the provided `range`.

Expand All @@ -107,7 +98,7 @@ This function may return symbols that are not returned by the `symbols()` or `cu
as these only return high-level symbols, like classes and functions, but not symbols within functions.
`symbolUnderCursor()` can however return these Symbols.

#### <a name="symbols"></a>array<[Symbol](../script/symbol.md)> **symbols**()
#### <a name="symbols"></a>array&lt;[Symbol](../script/symbol.md)> **symbols**()

Returns the list of symbols in the current document.

Expand Down
16 changes: 8 additions & 8 deletions docs/API/script/cppdocument.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Inherited properties: [CodeDocument properties](../script/codedocument.md#proper
|[CppDocument](../script/cppdocument.md) |**[openHeaderSource](#openHeaderSource)**()|
|QStringList |**[primitiveTypes](#primitiveTypes)**()|
|[QueryMatch](../script/querymatch.md) |**[queryClassDefinition](#queryClassDefinition)**(string className)|
|array<[QueryMatch](../script/querymatch.md)> |**[queryFunctionCall](#queryFunctionCall)**(string functionName)|
|array<[QueryMatch](../script/querymatch.md)> |**[queryFunctionCall](#queryFunctionCall)**(string functionName, array<string> argumentCaptures)|
|array&lt;[QueryMatch](../script/querymatch.md)> |**[queryFunctionCall](#queryFunctionCall)**(string functionName)|
|array&lt;[QueryMatch](../script/querymatch.md)> |**[queryFunctionCall](#queryFunctionCall)**(string functionName, array&lt;string> argumentCaptures)|
|[QueryMatch](../script/querymatch.md) |**[queryMember](#queryMember)**(string className, string memberName)|
|array<[QueryMatch](../script/querymatch.md)> |**[queryMethodDeclaration](#queryMethodDeclaration)**(string className, string functionName)|
|array<[QueryMatch](../script/querymatch.md)> |**[queryMethodDefinition](#queryMethodDefinition)**(string scope, string methodName)|
|array&lt;[QueryMatch](../script/querymatch.md)> |**[queryMethodDeclaration](#queryMethodDeclaration)**(string className, string functionName)|
|array&lt;[QueryMatch](../script/querymatch.md)> |**[queryMethodDefinition](#queryMethodDefinition)**(string scope, string methodName)|
||**[removeInclude](#removeInclude)**(string include)|
|int |**[selectBlockEnd](#selectBlockEnd)**()|
|int |**[selectBlockStart](#selectBlockStart)**()|
Expand Down Expand Up @@ -248,7 +248,7 @@ The returned QueryMatch instance will have the following captures available:
- `base` - The list of base classes/structs, if any
- `body` - The body of the class or struct definition (including curly-braces)

#### <a name="queryFunctionCall"></a>array<[QueryMatch](../script/querymatch.md)> **queryFunctionCall**(string functionName)
#### <a name="queryFunctionCall"></a>array&lt;[QueryMatch](../script/querymatch.md)> **queryFunctionCall**(string functionName)

Returns the list of function calls to the function `functionName`, no matter how many arguments they were called with.

Expand All @@ -259,7 +259,7 @@ The returned QueryMatch instances will have the following captures available:
- `argument-list` - The entire list of arguments, including the surroundg parentheses `()`
- `arguments` - Each argument provided to the function call, in order, excluding any comments

#### <a name="queryFunctionCall"></a>array<[QueryMatch](../script/querymatch.md)> **queryFunctionCall**(string functionName, array<string> argumentCaptures)
#### <a name="queryFunctionCall"></a>array&lt;[QueryMatch](../script/querymatch.md)> **queryFunctionCall**(string functionName, array&lt;string> argumentCaptures)

Returns the list of function calls to the function `functionName`.
Only calls that have the same number of arguments as `argumentCaptures` will be returned.
Expand All @@ -286,7 +286,7 @@ The returned QueryMatch instance will have the following captures available:
- `type`: The type of the member, without `const` or any reference/pointer specifiers (i.e. `&`/`*`)
- `name`: The name of the member (should be equal to memberName)

#### <a name="queryMethodDeclaration"></a>array<[QueryMatch](../script/querymatch.md)> **queryMethodDeclaration**(string className, string functionName)
#### <a name="queryMethodDeclaration"></a>array&lt;[QueryMatch](../script/querymatch.md)> **queryMethodDeclaration**(string className, string functionName)

Finds the declaration of a method inside a class or struct definition.

Expand All @@ -299,7 +299,7 @@ The returned QueryMatch instances contain the following captures:
- `function`: The function declaration, without the return type
- `name`: The name of the function

#### <a name="queryMethodDefinition"></a>array<[QueryMatch](../script/querymatch.md)> **queryMethodDefinition**(string scope, string methodName)
#### <a name="queryMethodDefinition"></a>array&lt;[QueryMatch](../script/querymatch.md)> **queryMethodDefinition**(string scope, string methodName)

Returns the list of methods definitions matching the given name and scope.
`scope` may be either a class name, a namespace or empty.
Expand Down
6 changes: 3 additions & 3 deletions docs/API/script/dir.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ import Script
|[QDirValueType](../script/qdirvaluetype.md) |**[home](#home)**()|
|bool |**[isAbsolutePath](#isAbsolutePath)**(string path)|
|bool |**[isRelativePath](#isRelativePath)**(string path)|
|bool |**[match](#match)**(array<string> filters, string fileName)|
|bool |**[match](#match)**(array&lt;string> filters, string fileName)|
|bool |**[match](#match)**(string filter, string fileName)|
|[QDirValueType](../script/qdirvaluetype.md) |**[root](#root)**()|
|[QDirValueType](../script/qdirvaluetype.md) |**[temp](#temp)**()|
|string |**[toNativeSeparators](#toNativeSeparators)**(string pathName)|

## Detailed Description

The `Dir` singleton implements most of the static methods from `QDir`, check [QDir](https://doc.qt.io/qt-5/qdir.html)
The `Dir` singleton implements most of the static methods from `QDir`, check [QDir](https://doc.qt.io/qt-6/qdir.html)
documentation.

## Property Documentation
Expand Down Expand Up @@ -72,7 +72,7 @@ documentation.

#### <a name="isRelativePath"></a>bool **isRelativePath**(string path)

#### <a name="match"></a>bool **match**(array<string> filters, string fileName)<br/>bool **match**(string filter, string fileName)
#### <a name="match"></a>bool **match**(array&lt;string> filters, string fileName)<br/>bool **match**(string filter, string fileName)

#### <a name="root"></a>[QDirValueType](../script/qdirvaluetype.md) **root**()

Expand Down
2 changes: 2 additions & 0 deletions docs/API/script/document.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ A document is a file loaded by Knut and that can be used in script (either to ge

#### <a name="errorString"></a>string **errorString**

Returns the error string if an error occurred while loading the document, otherwise returns an empty string.

#### <a name="exists"></a>bool **exists**

Returns true if the document is a file on the disk, otherwise returns false.
Expand Down
2 changes: 1 addition & 1 deletion docs/API/script/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Script
## Detailed Description

The `File` singleton implements most of the static methods from `QFile`, check
[QFile](https://doc.qt.io/qt-5/qfile.html) documentation.
[QFile](https://doc.qt.io/qt-6/qfile.html) documentation.

## Method Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/API/script/fileinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Script
## Detailed Description

The `FileInfo` singleton implements most of the static methods from `QFileInfo`, check
[QFileInfo](https://doc.qt.io/qt-5/qfileinfo.html) documentation.
[QFileInfo](https://doc.qt.io/qt-6/qfileinfo.html) documentation.

## Method Documentation

Expand Down
8 changes: 4 additions & 4 deletions docs/API/script/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import Script

| | Name |
|-|-|
|array<string>|**[actionIds](#actionIds)**|
|array<[MenuItem](../script/menuitem.md)>|**[children](#children)**|
|array&lt;string>|**[actionIds](#actionIds)**|
|array&lt;[MenuItem](../script/menuitem.md)>|**[children](#children)**|
|string|**[id](#id)**|

## Methods
Expand All @@ -22,11 +22,11 @@ import Script

## Property Documentation

#### <a name="actionIds"></a>array<string> **actionIds**
#### <a name="actionIds"></a>array&lt;string> **actionIds**

This property holds all action ids used in the menu.

#### <a name="children"></a>array<[MenuItem](../script/menuitem.md)> **children**
#### <a name="children"></a>array&lt;[MenuItem](../script/menuitem.md)> **children**

This property holds the list of menu items inside the menu.

Expand Down
4 changes: 2 additions & 2 deletions docs/API/script/menuitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Script

| | Name |
|-|-|
|array<[MenuItem](../script/menuitem.md)>|**[children](#children)**|
|array&lt;[MenuItem](../script/menuitem.md)>|**[children](#children)**|
|string|**[id](#id)**|
|bool|**[isAction](#isAction)**|
|bool|**[isSeparator](#isSeparator)**|
Expand All @@ -19,7 +19,7 @@ import Script

## Property Documentation

#### <a name="children"></a>array<[MenuItem](../script/menuitem.md)> **children**
#### <a name="children"></a>array&lt;[MenuItem](../script/menuitem.md)> **children**

This property holds the children of the menu item, in case this one is another level of menu.

Expand Down
37 changes: 21 additions & 16 deletions docs/API/script/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ import Script
| | Name |
|-|-|
|string|**[currentDocument](#currentDocument)**|
|array<string>|**[documents](#documents)**|
|array&lt;string>|**[documents](#documents)**|
|string|**[root](#root)**|

## Methods

| | Name |
|-|-|
|array<string> |**[allFiles](#allFiles)**(PathType type = RelativeToRoot)|
|array<string> |**[allFilesWithExtension](#allFilesWithExtension)**(string extension, PathType type = RelativeToRoot)|
|array<string> |**[allFilesWithExtensions](#allFilesWithExtensions)**(array<string> extensions, PathType type = RelativeToRoot)|
|array&lt;string> |**[allFiles](#allFiles)**(PathType type = RelativeToRoot)|
|array&lt;string> |**[allFilesWithExtension](#allFilesWithExtension)**(string extension, PathType type = RelativeToRoot)|
|array&lt;string> |**[allFilesWithExtensions](#allFilesWithExtensions)**(array&lt;string> extensions, PathType type = RelativeToRoot)|
||**[closeAll](#closeAll)**()|
|[Document](../script/document.md) |**[get](#get)**(string fileName)|
|[Document](../script/document.md) |**[open](#open)**(string fileName)|
||**[openPrevious](#openPrevious)**(int index)|
||**[openPrevious](#openPrevious)**(int index = 1)|
||**[saveAllDocuments](#saveAllDocuments)**()|

## Detailed Description
Expand All @@ -37,7 +37,7 @@ The `Project` object is not meant to open multiple projects, but only open one.

Current document opened in the project.

#### <a name="documents"></a>array<string> **documents**
#### <a name="documents"></a>array&lt;string> **documents**

Return all documents opened in the project.

Expand All @@ -47,23 +47,23 @@ Current root path of the project, this can be set only once.

## Method Documentation

#### <a name="allFiles"></a>array<string> **allFiles**(PathType type = RelativeToRoot)
#### <a name="allFiles"></a>array&lt;string> **allFiles**(PathType type = RelativeToRoot)

Returns all files in the current project.
`type` defines the type of path, and can be one of those values:

- `Project.FullPath`
- `Project.RelativeToRoot`

#### <a name="allFilesWithExtension"></a>array<string> **allFilesWithExtension**(string extension, PathType type = RelativeToRoot)
#### <a name="allFilesWithExtension"></a>array&lt;string> **allFilesWithExtension**(string extension, PathType type = RelativeToRoot)

Returns all files with the `extension` given in the current project.
`type` defines the type of path, and can be one of those values:

- `Project.FullPath`
- `Project.RelativeToRoot`

#### <a name="allFilesWithExtensions"></a>array<string> **allFilesWithExtensions**(array<string> extensions, PathType type = RelativeToRoot)
#### <a name="allFilesWithExtensions"></a>array&lt;string> **allFilesWithExtensions**(array&lt;string> extensions, PathType type = RelativeToRoot)

Returns all files with an extension from `extensions` in the current project.
`type` defines the type of path, and can be one of those values:
Expand All @@ -77,18 +77,23 @@ Close all documents. If the document has some changes, save the changes.

#### <a name="get"></a>[Document](../script/document.md) **get**(string fileName)

Get the document for the given `fileName`. If the document is not opened yet, open it. If the document already
exists, returns the same instance, a document can't be open twice. If the fileName is relative, use the root path as
the base.
Gets the document for the given `fileName`. If the document is not opened yet, open it. If the document
is already opened, returns the same instance, a document can't be open twice. If the fileName is relative, use the
root path as the base.

*Note:* this command does not change the current document.
If the document does not exist, creates a new document (but don't save it yet).

!!! note
This command does not change the current document.

#### <a name="open"></a>[Document](../script/document.md) **open**(string fileName)

Opens a document for the given `fileName` and make it current. If the document already exists, returns the same
instance, a document can't be open twice. If the fileName is relative, use the root path as the base.
Opens or creates a document for the given `fileName` and make it current. If the document is already opened, returns
the same instance, a document can't be open twice. If the fileName is relative, use the root path as the base.

If the document does not exist, creates a new document (but don't save it yet).

#### <a name="openPrevious"></a>**openPrevious**(int index)
#### <a name="openPrevious"></a>**openPrevious**(int index = 1)

Open a previously opened document. `index` is the position of this document in the last opened document.

Expand Down
Loading
Loading