mirror of
https://ghproxy.net/https://github.com/serpwings/static-wordpress.git
synced 2025-10-04 06:00:34 +08:00
update project documentation
This commit is contained in:
parent
52c35bbe38
commit
daa127905f
5 changed files with 60 additions and 32 deletions
3
docs/core-project.md
Normal file
3
docs/core-project.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Project Class
|
||||
|
||||
::: staticwordpress.core.project.Project
|
|
@ -1,14 +1,20 @@
|
|||
# staticwordpress
|
||||
# static-wordpress
|
||||
|
||||
Python Package for Converting WordPress Installation to a Static Website.
|
||||
|
||||
[](https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml)
|
||||
[](https://github.com/pleiszenburg/staticwordpress/blob/master/LICENSE)
|
||||
[](https://github.com/pleiszenburg/staticwordpress/milestone/1)
|
||||
[](https://pypi.python.org/pypi/staticwordpress)
|
||||
[](https://pypi.python.org/pypi/staticwordpress)
|
||||
|
||||
## How to Install staticwordpress?
|
||||
## How to Install static-wordpress?
|
||||
|
||||
### Windows Installer
|
||||
|
||||
We provide an ``exe`` file of ``staticwordpress`` for the convenice of users. Please download the latest version from [release section](https://github.com/serpwings/static-wordpress/releases).
|
||||
|
||||
|
||||
### Source Code
|
||||
|
||||
- Clone or download this repository to your computer.
|
||||
|
@ -23,9 +29,18 @@ This package is available at ``pypi`` and you can install it with ``pip install
|
|||
Once installed, you can implement customized workflows. Here is an example of post processing simply-static-zip file.
|
||||
|
||||
```python
|
||||
import logging
|
||||
|
||||
from staticwordpress.core.workflow import Workflow
|
||||
from staticwordpress.core.constants import SOURCE, HOST
|
||||
|
||||
# enable logging for all functions.
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
level=logging.DEBUG,
|
||||
stream=sys.stdout,
|
||||
)
|
||||
|
||||
swp = Workflow()
|
||||
swp.create_project(
|
||||
project_name_="simply-static-zip-deploy",
|
||||
|
@ -33,8 +48,8 @@ swp.create_project(
|
|||
wp_api_token_=env_wp_api_token, # wordpress xml api token
|
||||
src_url_=env_src_url, # source url where WordPress is hosted
|
||||
dst_url_=env_dst_url, # destination url where you want to host Static version
|
||||
output_folder_=env_output, # Output folder location, where all post processed files will be saved
|
||||
src_type_=SOURCE.ZIP, # Data Source, ZIP works perfectly right with Simply Static WordPress Plugin
|
||||
output_folder_=env_output, # Output folder location, where processed files will be saved
|
||||
src_type_=SOURCE.ZIP, # Data Source e.g. ZIP file from Simply Static WordPress Plugin
|
||||
host_type_=HOST.NETLIFY, # Host, where you want to deplyo your website.
|
||||
)
|
||||
|
||||
|
@ -48,32 +63,16 @@ swp.add_search()
|
|||
|
||||
## Documentation
|
||||
|
||||
Detailed documentation of all features is available at [staticwordpress documentation](https://serpwings.com/static-wordpress/).
|
||||
Detailed documentation of all features is available at [staticwordpress documentation](https://static-wordpress-docs.netlify.app/).
|
||||
|
||||
## TODO:
|
||||
|
||||
Following tasks need attention. This list is without any priority.
|
||||
|
||||
- Base Package
|
||||
- Translations
|
||||
- Redirects
|
||||
- Vercel
|
||||
- Cloudflare Pages
|
||||
- others.
|
||||
- 3rd Party Crawlers
|
||||
- Process Folder data e.g. Simply Static
|
||||
- Search
|
||||
- Use Builint Interace
|
||||
- Results for paramterized urls
|
||||
- Dcoumentation
|
||||
- GUI
|
||||
- Recent Projects
|
||||
- Improve Progressbar
|
||||
|
||||
## Contribute
|
||||
|
||||
Pull Requests, Feature Suggestions, and collaborations are welcome.
|
||||
|
||||
## ICONS
|
||||
|
||||
Icons used in this project are obtained from Google [Fonts Material Symbols](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:search:FILL@0;wght@400;GRAD@0;opsz@24)
|
||||
|
||||
## About Us
|
||||
|
||||
This work is a collaborative effort of [seowings](https://www.seowings.org/), and [serpwings](https://serpwings.com/).
|
||||
This work is a collaborative effort of [seowings](https://www.seowings.org/), and [serpwings](https://serpwings.com/).
|
||||
|
|
|
@ -10,6 +10,8 @@ edit_uri: blob/main/docs/
|
|||
nav:
|
||||
- Home: index.md
|
||||
- Tutorial: tutorial.md
|
||||
- Core:
|
||||
- Project Class: core-project.md
|
||||
|
||||
plugins:
|
||||
- search
|
||||
|
|
|
@ -422,9 +422,21 @@ class StaticWordPressGUI(QMainWindow):
|
|||
pdialog = ProjectDialog(self, self._project, title_="Current Project")
|
||||
if pdialog.exec_():
|
||||
self._project = pdialog._project
|
||||
|
||||
self._project.save()
|
||||
self.update_widgets()
|
||||
self._project.save()
|
||||
self.update_widgets()
|
||||
else:
|
||||
msgBox = QMessageBox(parent=self)
|
||||
msgBox.setText(f"No Project Available.")
|
||||
msgBox.addButton(QMessageBox.Ok).setIcon(
|
||||
QIcon(f"{SHARE_FOLDER_PATH}/icons/ok.svg")
|
||||
)
|
||||
msgBox.setWindowIcon(
|
||||
QIcon(f"{SHARE_FOLDER_PATH}/icons/static-wordpress.svg")
|
||||
)
|
||||
msgBox.setTextFormat(Qt.RichText)
|
||||
msgBox.setWindowTitle("Project Settings")
|
||||
msgBox.exec()
|
||||
logging.info("No New Project found.")
|
||||
|
||||
@is_project_open
|
||||
@logging_decorator
|
||||
|
|
|
@ -22,6 +22,7 @@ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
|
|||
specific language governing rights and limitations under the License.
|
||||
</LICENSE_BLOCK>
|
||||
"""
|
||||
|
||||
# +++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# STANDARD LIBARY IMPORTS
|
||||
# +++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -52,7 +53,6 @@ from PyQt5.QtWidgets import (
|
|||
QMessageBox,
|
||||
QFileDialog,
|
||||
QPushButton,
|
||||
QAction,
|
||||
)
|
||||
from PyQt5.QtCore import Qt, QSettings, QSize, QThread
|
||||
from PyQt5.QtGui import QIcon
|
||||
|
@ -70,6 +70,7 @@ from ..core.constants import (
|
|||
HOST,
|
||||
)
|
||||
|
||||
from ..core.project import Project
|
||||
from ..core.utils import is_url_valid
|
||||
from ..gui.workflow import WorkflowGUI
|
||||
|
||||
|
@ -85,10 +86,10 @@ class ProjectDialog(QDialog):
|
|||
CONFIGS["APPLICATION_NAME"], CONFIGS["APPLICATION_NAME"]
|
||||
)
|
||||
|
||||
self._project = project_
|
||||
self._bg_thread = QThread(parent=self)
|
||||
self._bg_worker = WorkflowGUI()
|
||||
|
||||
self._project = project_
|
||||
vertical_layout_project = QVBoxLayout()
|
||||
groupbox_general_settings = QGroupBox("General Settings")
|
||||
form_layout_general_settings = QFormLayout()
|
||||
|
@ -458,7 +459,16 @@ class ProjectDialog(QDialog):
|
|||
Path(self.lineedit_output.text()).is_dir(),
|
||||
]
|
||||
):
|
||||
self._project.create()
|
||||
logging.info(f"Current Project: {self.lineedit_output.text()} is valid")
|
||||
logging.info(f"Current Url: {self.lineedit_src_url.text()} is valid")
|
||||
logging.info(
|
||||
f"Current Project Path: {self.lineedit_output.text()} is valid"
|
||||
)
|
||||
|
||||
if not self._project.is_open():
|
||||
self._project = Project()
|
||||
self._project.create()
|
||||
|
||||
self._project.output = Path(self.lineedit_output.text())
|
||||
self._project.path = Path(f"{self._project.output}/._data/.project.json")
|
||||
self._project.name = self.lineedit_project_name.text()
|
||||
|
@ -486,6 +496,8 @@ class ProjectDialog(QDialog):
|
|||
)
|
||||
return super().accept()
|
||||
else:
|
||||
logging.info(f"Current Project Settings are not valid.")
|
||||
|
||||
msgBox = QMessageBox(parent=self)
|
||||
msgBox.setText(
|
||||
"Cannot start this project.<br>Please check project settings."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue