Skip to content

Latest commit

 

History

History
142 lines (98 loc) · 6.74 KB

File metadata and controls

142 lines (98 loc) · 6.74 KB

AutoHotkey.net Website Generator

Generates a website automatically using information gathered from the AutoHotkey Forums.

Examples

Here are some examples of websites generated by this program:

And here are some sites people have built based on the generated pages:

Usage

AutoHotkey.net Website Generator supports configuration through either variables at the top of the main script, through command line parameters, or through a GUI.

Variable configuration

Setting the variables at the top of the main script, "Website Generator.ahk", will affect how the script works if it is run without any other configuration. This may be useful when one desires to schedule website updates automatically or on a schedule. However, command line configuration may be more appropriate in some cases.

Command line configuration

Command line parameters override the variables set at the top of the main script. Parameter names mirror the names of the aforementioned variables:

GenerateWebsite.ahk --ShowGUI=False --ForumUsername=Uberi --UploadWebsite=True --AutoHotkeyNetPassword=MyPassword --ColorScheme=Blue > Log.txt

The above would silently generate a page for the user "Uberi" at the AutoHotkey Forums with a blue color scheme, and then upload it to AutoHotkey.net over FTP. Any errors encountered would be reported in Log.txt

GUI configuration

A configuration GUI will be shown if the "ShowGUI" option is set. This option also enables usage of a configuration file, which is in INI format.

Options

Credentials

  • ForumUsername - The forum username to generate the website for.
  • AutoHotkeyNetUsername - The AutoHotkey.net account username. Leave blank if it is the same as the forum username.

Upload

  • UploadWebsite - Upload the website to AutoHotkey.net after it has been generated.
  • AutoHotkeyNetPassword - The AutoHotkey.net account password. Necessary only if UploadWebsite is set.

Search

  • SearchEnglishForum - Search the English AutoHotkey Forums for posts.
  • SearchGermanForum - Search the German AutoHotkey Forums for posts.

Behavior

  • ShowGUI - Show the configuration GUI on startup.
  • UseCache - Use the information cache to avoid downloading unnecessary data.
  • RelativeLinks - Rewrite links to scripts to make them relative to the webpage if possible.
  • DownloadResources - Download resources such as scripts and images to the website directory, to make the generated website self contained.

Appearance

  • Stylesheet - The stylesheet to use for the generated website, without the ".css" extension.
  • SortEntries - Whether or not to sort the website entries alphabetically. If not set, the script will sort by the time of the last update.

Output

  • OutputDirectory - The local directory to save the generated website.

Templates

Templates are located in subdirectories within the "Resources" directory of AutoHotkey.net Website Generator, and are named after those subdirectories. Every file in that folder will be directly copied to the output, except for the following file types, which are run through the templating engine before being output:

  • *.htm
  • *.html
  • *.css

Invalid properties or mismatched tags result in the tag being ignored. All HTML special characters are escaped.

See existing templates for examples of usage.

Template Tags

<ahk_script PROPERTY>

Self contained tag that is a placeholder for data specified by PROPERTY, where PROPERTY may be either a template or script property (script properties are only available if the tag is contained within an <ahk_for_each> tag). Both types of properties are documented below.

<ahk_for_each SCRIPT_TYPE>

Matched tag that searches the AutoHotkey forum for scripts of type SCRIPT_TYPE, where SCRIPT_TYPE may be either "Script" or "Library", and duplicates the contents of the tag for each search result. Tag contents may contain template tags; they will be processed separately for each iteration.

<ahk_if PROPERTY>

Matched tag that does nothing if the data specified by PROPERTY is present, where PROPERTY may be either a template or script property (script properties are only available if the tag is contained within an <ahk_for_each> tag), but otherwise prevents the tag contents from reaching the output.

<ahk_if_not PROPERTY>

Matched tag that prevents the tag contents from reaching the output if the data specified by PROPERTY is present, where PROPERTY may be either a template or script property (script properties are only available if the tag is contained within an <ahk_for_each> tag), but otherwise does nothing.

Tag Properties

The following properties are available anywhere in a template:

  • Author - The forum username of the person generating the webpage.
  • Time - The time webpage generation was started.
  • Date - The date webpage generation was started.
  • Template - The name of the template.

The following properties are available within an <ahk_for_each> tag:

  • Index - The index of the current script in the search results.
  • Fragment - A unique generated string suitable for use as a URL fragment identifying the script entry.
  • Title - The title of the forum topic taken from the search results.
  • Image - An optional image that may be related to the script.
  • Description - A description of the script.
  • Topic - The URL of the forum topic.
  • Source - The optional download URL.

License

Copyright 2011 Anthony Zhang azhang9@gmail.com

This file is part of AutoHotkey.net Website Generator. Source code is available at https://github.com/Uberi/AutoHotkey.net-Website-Generator.

AutoHotkey.net Website Generator is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.