Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

CMS for autohotkey.net


  • Please log in to reply
7 replies to this topic
AGU
  • Guests
  • Last active:
  • Joined: --
Hello everyone,

I talked to Titan recently about an idea I had. It was about s.th like a little CMS for your autohotkey.net account. A little CMS that lets you specify a screenshot, a little description, maybe some lines of documentation, ...
Finally you would push a button and it'll generate a nice layouted website of it which could be uploaded to your autohotkey.net account. In this way all user pages on autohotkey.net would have some form of standard layout for easier orientation.
As it would be very difficult to implement that within the existing file manager, we both agree this would be very difficult to nearly impossible.

That's where I had another idea. We already have a fabulous tool named Autohotkey. By writing the preview routine for BBCodeWriter I know it's possible to generate a HTML site out of an Autohotkey script. So why not making a little tool based on Autohotkey with a nice GUI that lets you type or specify all this infos and let it generate this website for you? What do you think about this idea?

As an autohotkey scripter is by definition a lazy person ;) (why would he/she otherwise use Autohotkey to automate certain tasks) he/she doesn't like to do all this work to design a nice website. Why not using Autohotkey to automate this task, too?

I already made some basic thoughts on this.
[*:2cg8aou2]generate an index site in case you have more than one script to present
[*:2cg8aou2]generate a single page for each script
[*:2cg8aou2]implement some navigation for each site that jumps to the diffenent paragraphs (Screenshot, Code, descrition, ...)
[*:2cg8aou2]maybe even some upload possibility that lets you upload everything via FTP
Tell me what you think about it or share your ideas on this.

_________________
Cheers
AGU
Posted Image

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Creating a whole new website editor with AutoHotkey eh? Seems like a big task but it can be done. The principle is similar to RSS Editor, a GUI based CMS that uses XMLWrite to update XML content.

For example:



Untitled Document

Call XMLWrite(file, "head.generator:title.title", "New Title") to change the title whilst preserving a well-formed XHTML document.

As for FTP, well that's already possible (see FileAppend in the docs). Perhaps if someone has the time they could create such a script.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


AGU
  • Guests
  • Last active:
  • Joined: --

Creating a whole new website editor with AutoHotkey eh?

Didn't meant it to be so complicated. ;)

I would start out by making a webdesign. Then take this raw HTML code and append it to a HTML page. During appending I would fill the rest of the template/HTML page with the content of the variables.
OK, you couldn't create very individual websites but it would save you a lot of work.
__________________
Cheers
AGU

Dragonscloud
  • Members
  • 96 posts
  • Last active: Jul 21 2010 08:33 PM
  • Joined: 16 Jul 2005

I would start out by making a webdesign. Then take this raw HTML code and append it to a HTML page. During appending I would fill the rest of the template/HTML page with the content of the variables.
OK, you couldn't create very individual websites but it would save you a lot of work.


That approach sounds much more practical to me than making an html generator. I used the substitutions method in my Diary-x style journal creator and it worked quite well. The template looked something like this:
(html tags/stylesheet)
[title]
[date]
[body] ;main content goes here
(html sidebar tags)
[prev][curr][next][arch] ; navigation links
(closing tags)

Do I understand correctly that the idea is to use a script to generate the pages on localhost then upload the pages to autohotkey.net?

Actually you can create very individualized websites in this manner. All it takes is to edit the template(s). One can also implement user-defined substitution tags and customize how the link text, etc., in the substitutions appears.
“yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation.

AGU
  • Guests
  • Last active:
  • Joined: --
Sorry Dragonscloud for answerog so late. :oops:

Do I understand correctly that the idea is to use a script to generate the pages on localhost then upload the pages to autohotkey.net?

Yep. :mrgreen: This is exactly the way it should happen.
I already thought about integrating the ftp-upload into that app. But this is a very rough idea. Means filling the GUI with the needed information, generating the websites for the scripts, maybe generating an index site, and finally uploading the complete directory on localhost to the own autohotkey.net account.

I didn't make any thoughts yet on updating an existing web project generated with this app. Let's say you already made an index page and have 2-3 pages about scripts. Generating another page for another script wouldn't be a problem but what about updating the index page? Will have to think about it.

Actually you can create very individualized websites in this manner. All it takes is to edit the template(s). One can also implement user-defined substitution tags and customize how the link text, etc., in the substitutions appears.

Sounds interesting, although I don't understand everything. What do you mean with user-defined substitution tags?
I thought the complete HTML code would be inside of an AHK script within a FileAppend command and with the help of a continuation section. S.th like this:
FileAppend,
    (LTrim
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link rel="stylesheet" type="text/css" href="./phpbb/style.css" />
      
        <title>BBCodeWriter Preview</title>
      </head>
      
      <body>
        <div id="head">
          <img id="logo" src="phpbb/images/logo.jpg" alt="" />
          <h1 id="title">%ScriptName%</h1>
        </div>
      
        <div id="postbody">
          <p id="postheader">Message</p>
          <div id="posttext">
    ), preview.html
    ...

If you have a better idea with this templates and what you call substution tags I would be very interested. Can you give me some details about this? Maybe a short example so that I can see how this should work?
____________________
Cheers
AGU

Dragonscloud
  • Members
  • 96 posts
  • Last active: Jul 21 2010 08:33 PM
  • Joined: 16 Jul 2005
@AGU:

Please pardon my late response as well. I'm having issues.

I haven't worked on the ftp aspects of my app yet. I'll do that after I find the bug in my code that fails to correctly update the previous and next links in the adjoining pages when an entry is deleted. I might end up rewriting the entire script using helper functions that I got sidetracked on.
The code is very sloppy and inconsistent in the original script.

As for updating an existing page, that shouldn't be a problem. I added an edit feature into the gui. It just uses a simple file replace. Works fine on localhost, but then I'd need to ftp the updates to the web host. Unfortunately my webhosting doesn't allow for running scripts on the server and I'm on dialup so it would take a while to implement a global template change on a journal with a lot of entries.

Templates:
I store these as external text files for flexibility and customization.

User-defined substitutions:
These allow the user to create their own custom tags which can be inserted anywhere in the template or in the journal entry itself.
ex. for paragraph indentation, [s] can be replaced with space characters.
I wrote the following function to facilitate the process:
UserSubs(IniFileName, Section, FilePattern) 
{
  Loop, Read, %IniFileName%
    { if A_LoopReadLine  contains [%Section%]
      BeginningOfSection := A_Index
      EndOfSection++
    }
  Loop, %FilePattern%
    { FileRead, InputText, %A_LoopFileFullPath%   
      Loop, Read, %IniFileName%
        { If A_Index > %BeginningOfSection%
            {Line = %A_LoopReadLine% 
              { StringSplit, Text, Line, = 
                StringReplace, InputText, InputText, [%Text1%], %Text2%, all
                If A_Index = %EndOfSection%
                  { FileDelete, %A_LoopFileFullPath%
                    FileAppend, %InputText%, %A_LoopFileFullPath%
                  }
                }
            } 
        }
    }
}
;example
UserSubs("settings.ini", "UserSubstitutions", "text\*.txt")

If the UserSubstitutions section of settings.ini had the key btw=by the way,
the tag [btw] would be replaced with by the way in all files matching the FilePattern parameter.
“yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation.

AGU
  • Guests
  • Last active:
  • Joined: --
Meanwhile I made a first attempt to create a template/empty site/design/whatever you might call it. Take a look if you like:
https://ahknet.autoh... ... index.html

As I'm not very expirienced in webdesign any help is appreciated. Or propose another design.
___________________
Cheers
AGU

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Nice design, I would suggest fixing the two small errors that make it XHTML invalid. Also you should make it 1.0 Transitional instead of Strict so users can edit the code without having to conform to too many guidelines.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit