Skip to content
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

Update doc #66

Merged
merged 2 commits into from
Aug 11, 2023
Merged
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
24 changes: 21 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
version: 2
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

sphinx:
configuration: docs/source/conf.py
# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion docs/source/conf.py → docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import os
import sys

sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('source'))

# -- Project information -----------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
groundwork-sphinx-theme
34 changes: 34 additions & 0 deletions docs/source/docs/Eng/how_to_extend_ui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
How to extend FrontEngine UI
----

.. image:: image/FrontEngine.png

.. code-block::

from PySide6.QtWidgets import QWidget, QGridLayout, QLineEdit, QPushButton, QLabel

from frontengine import start_front_engine, FrontEngine_EXTEND_TAB


class TestUI(QWidget):

def __init__(self):
super().__init__()
self.grid_layout = QGridLayout(self)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.label = QLabel("")
self.line_edit = QLineEdit()
self.submit_button = QPushButton("Submit")
self.submit_button.clicked.connect(self.show_input_text)
self.grid_layout.addWidget(self.label, 0, 0)
self.grid_layout.addWidget(self.line_edit, 1, 0)
self.grid_layout.addWidget(self.submit_button, 2, 0)

def show_input_text(self):
self.label.setText(self.line_edit.text())


FrontEngine_EXTEND_TAB.update({"test": TestUI})

start_front_engine(debug=True)
34 changes: 34 additions & 0 deletions docs/source/docs/Zh/how_to_extend_ui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
怎麼擴充 FrontEngine UI
----

.. image:: image/FrontEngine.png

.. code-block::

from PySide6.QtWidgets import QWidget, QGridLayout, QLineEdit, QPushButton, QLabel

from frontengine import start_front_engine, FrontEngine_EXTEND_TAB


class TestUI(QWidget):

def __init__(self):
super().__init__()
self.grid_layout = QGridLayout(self)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.grid_layout.setContentsMargins(0, 0, 0, 0)
self.label = QLabel("")
self.line_edit = QLineEdit()
self.submit_button = QPushButton("Submit")
self.submit_button.clicked.connect(self.show_input_text)
self.grid_layout.addWidget(self.label, 0, 0)
self.grid_layout.addWidget(self.line_edit, 1, 0)
self.grid_layout.addWidget(self.submit_button, 2, 0)

def show_input_text(self):
self.label.setText(self.line_edit.text())


FrontEngine_EXTEND_TAB.update({"test": TestUI})

start_front_engine(debug=True)