Network utilities

I hid in this forum for a long time, and I found it the most useful. This is my first question, so forgive me if it is incorrectly worded. I am looking for a simple nawk (the server does not belong to me, so I can’t install gawk even if I wanted to) CMS or a shell / awk scriptbook to help me manage my growing collection of clean XHTML 1.0 / CSS files, which are my personal site. I tried TinyTim and Blis on my personal computer. Besides the fact that they are not portable (sorry, but Bash and gawk are not standard Unix tools), I found that they are not fully functional. Can anyone suggest any other solutions? I have my own growing collection of quick scripts, but I need something more reliable. I am ready to consider a simple solution based on Perl. Python will stretch, but I really like this language, and I use it daily for scientific computing, so I want to at least learn about it.

+4
source share
3 answers

Interest Ask! But this is not a traditional answer. I have numerous comments that will not fit well in the SO comment format, so please forgive this violation of etiquette.

As far as I like * awk, I see several obstacles.

1. I do not know any CMS tools created using nawk. I have a lot of experience with awk, and as you discovered, there are several (TinyTim and Blis), but they are based on bash / gawk and they are not as fully functional as you need.

When I went to the awk motherboard (www.awk.info), I had a clear impression that the site was hacked. I found a tiny CMS in awk , but suppose it's a gawk based system. Two sites have similar authors, so I’m afraid that this can also be hacked. Caution!

2. It looks like you are thinking of a traditional awk command line system and a shell script. If so, my limited experience with CMS systems is that they are based on GUI systems for creating and managing content, which is why the creator of the GUI page AND THEN wraps the GUI around something similar to a traditional repository / SCCS system. CMS experts can list the differences.

So, why not just create some shell scripts around CVS or similar that will allow you to manage your repository as needed?

3. System Efficiency I: Using CVS as the location for the repository of your CMS system, consider how big this source code is and that it is written in 'C', which gives much finer access and control to subsystems related to ownership problems. files and security (like many others) than you can access in nawk or any shell. (Compiled C runs much faster, but on this day the 3Ghz + processors are not an absolute requirement to insist on code compliance)

4. System Efficiency II: You say you want to store XHTML 1.0 / CSS files basically. This is a serious rollback for your project, awk is a reg-ex based language and cannot parse XML-like data efficiently. You've been hiding enough here to read xml parsing in bash or complex conversions

Of course, the position that I was really looking for, I can not find! Search for phrases such as "friends do not allow friends to do XML in sed / awk / bash"; -)!

5. Re TinyTim and Blis: reconsider your objection to gawk / bash: these 2 excellent languages ​​are nawk and ksh super-kits (88). Depending on how little / less the script relies on gawk / bash for specific functions, in the end you may need to change the "she-bang" at the top of the file to #! / Bin / nawk, #! / Bin / ksh OR more Realistically, make this change, and then rewrite the code for nawk / ksh. Worst of all, the gawk and bash code are so heavily dependent on specific "proprietary" functions that are actually not practical to rewrite. It is worth a look.

To complete the image, see also gawkxml . Obviously a gawk system, but I did a conversion to nawk with some code changes. It worked for my needs, but I did not try to fix the case of the self-determining aspect of the code that did not work, - (

EDIT

6. Finally, look at the range of systems from the original awk creators in their classic book, Awk Programming Language, Chap 4 Reports and Databases, Relational Database System AND AND Chap, 6, Small Languages. There may be ideas for you (however, there was no pre-infected CMS;).


So, given that perl and python have excellent XML processing built-in through imported modules, I think you should seriously consider them or install something like xmlstarlet (at the SO links above) and write your shell system wrappers to work with it .

Hope this helps.

+3
source

I wrote a static site generator using awk and sh called Zodiac . It supports Markdown and simple HTML, a basic site layout, metadata and its written in POSIX awk and sh. This may be the awk-based content management system you are looking for.

+4
source

Try Jekyll:

http://jekyllrb.com/

You simply write text files using simple, intuitive syntax. Then, when you launch Jekyll, it generates a whole folder full of regular HTML files ready for download.

The code can be extended with Ruby plugins that add extra features.

It is supported by GitHub Pages : if you download a repository full of Markdown files, GitHub automatically launches Jekyll and places it on your personal subdomain.

There's also Hyde , which is written in Python, but I have not tried this.

A Google search for a “static website generator” will bring millions of results. Try a few and choose what you like!

+2
source

Source: https://habr.com/ru/post/1389385/


All Articles