SEO is extremely important for any website. One way to improve SEO is to add regularly updated content to your site like blog posts. However, this can be a tedious and time consuming process. When given just the text in the form of DOCX files from content writers or clients then having to manually type in the content and then upload it to a website builder, it can be a lot of work. DOCX-2-SEO is built to help streamline this process by converting a blog post written in a DOCX file into a properly styled HTML document with added buttons and images to be published as blogs on client websites.
DOCX-2-SEO is a desktop application built using Python and PyQT6 utilizing the BeautifulSoup4 and Mammoth Python libraries to convert formatted Microsoft Word documents (.docx) into properly styled HTML documents (.html) with added buttons and images to be published as blogs on client websites. UI currently is formatted specifically for macOS: the application should work on Windows and Linux, but the UI may not be as polished or have inconsistent styling.
There are a few things that need to be done to make sure you can get the development up and running on your end for DOCX-2-SEO. You can set this up with or without a python venv, but like all python project a venv is recommended:
-
Clone the repo to your machine
-
Make sure you are using Python version 3.9
-
Install all requirement using the command
pip install -r requirements.txt
-
Start making contributions. The application can be started by running the main.py file in the terminal
Clients hold styling, formatting, and other information to be used for generating the HTML document. You can create a client in the client tab by following these steps:
-
Select "New Client" from the dropdown menu.
-
Enter the name of the client into the "Name" field.
-
Enter the html code for the button you would like to appear in the document. The button code can be of any format so long it contains an anchor tag.
-
Enter any styling information on a per tag basis using the JSON format. For example, if you only wanted to style all paragraph tags such that they were 14px in size, bold, and red, you would enter the following code:
{
"p": {
"font-size": "14px",
"font-weight": "bold",
"color": "red"
}
}
Some client website builders may have the ability to add style tags. For these clients, you add the style tag like any other tag in the styling JSON with the value being a string of anything that should be contained in the style tag. The value must only be on a single like of text as well to stay in format with the JSON. For example, if you wanted to add a style tag with the class "my-style" and the value "color: red", you would enter the following code:
{
"style": ".my-style { color: red; }"
}
-
Enter the content section wrapper html code for the document. By default, this is set to a div tag with another nested div inside it. If further styling is needed, you can edit the properties of each div tag as you see fit. The wrapper code must contain two div tags with one nested inside the other.
-
Click "Save" to save the client.
Topics hold image src links, alt text, and redirect links to allow for automatic generation of the HTML document. You can create a topic in the topics tab by following these steps:
-
Select "New Topic" from the dropdown menu.
-
Enter the name of the topic into the "Name" field.
-
Enter the redirect link for the topic in the "Link" field.
-
Images are seperated into 4 different categories to help decide where to best place it based on the blog content: Hero, Tech, Interior, and Misc. Add a src link for a category by clicking the + button and entering the src link into the respective field.
-
After adding all img src links for the topic, click "Save"
Generating a HTML document is the process of converting the DOCX file into a properly styled HTML document with added buttons and images. You can generate a document in the generate tab by following these steps:
-
After launching the application, upload the DOCX file you want to convert in the generate tab.
-
Once the file is uploaded, select the client that you want to style the final HTML document for.
-
Select the generation type you want to use: Manual or Automatic.
3.1 Manual: Enter the text you would like to appear in any buttons (Defaults to "View Inventory") and the link you would like the buttons to lead to, click the "Generate" button, input the alt text and src links for any images you would like to have in the document, click submit, then save the file.
3.2 Automatic: Select the blog topic you would like to use for the document from the dropdown menu, if you would like to change the button text and link enter desired text and link into the respective fields, click "Generate" and then save the file.
Editing a client is the same as creating a client, except you can edit the existing client by selecting it from the dropdown menu and clicking "Save" after making changes.
Editing a topic is the same as creating a topic, except you can edit the existing topic by selecting it from the dropdown menu and clicking "Save" after making changes.
Deleting a client is simple and straightforward. Select the client you would like to delete from the dropdown menu and click "Delete" to remove it from the list.
Deleting a topic is simple and straightforward. Select the client you would like to delete the topic from and then select the topic itself from the dropdown menu and click "Delete" to remove it from the list.