Generate MkDocs pages in the browser - mkdocs

Is it possible to generate the pages for MkDocs dynamically/on-the-fly in the browser using JavaScript? In this case, the build process incl. all the required tools would not be necessary any longer. Since the build process generates static pages, I assume that generally this is possible, but haven't found any related information.

No this is not possible. McDocs is written in the Python Language, not Javasript. Page builds can only be run from the command line.

Related

In MediaWiki, perform an action on every page of a namespace through API or maintenance script

How to programmatically — through the API or through a maintenance script — do an action on every page from a specified namespace?
I would for example like to add every page of the main namespace into a specified category, for maintenance purpose.
I've had to do this on a few occasions.
It looks like the way to do things now is through the Pywikibot scripts. These are tools written in Python for automating tasks on MediaWiki sites. Unlike most of the MediaWiki documentation, the PWB docs are actually pretty thorough.
When I last had to add some text to every page, I couldn't find a bot that worked with my private instance running on my intranet, since most bots were written to work with Wikipedia.
What I ended up doing was just generating a list of page URLs, and then fed them to a custom script that utilized Selenium to automate a browser running on my machine. You can use Selenium from Java, Python, C#, and Ruby.
It's a pretty heavyweight approach though, since you actually have to be running a realtime browser to do the work.
Take a look at Pywikibot.

How to customize buildbot web pages

I am trying to make some extra web pages for a test buildbot, since I am planning to have one running my project.
Practically I would like to have a waterfall page that show the button to build a specific builder, close to the build name, instead than in the builder page only. I would also like to have some reference documents loaded from inside the builder work folder, and from other locations on the slave machine; using buttons to display or hide them.
I've looked at the manual and I do not see any info about how do you customize or create new html pages, that can leverage on the Buildbot features (like the templates already included with Buildbot do).
I have opened some pages, and see that there are some html files that actually has non-html code statements like
% macro
% for
And so on. I am not a web programmer so I am quite clueless about what should I look for. Tried to google the word macro for HTML and I just got a bunch of results related to Wiki customization; it does not look like it is Python language so I am quite lost.
Is there anyone that was successfully able to make custom pages for the buildbot, and could give me some pointers about what to learn?
Buildbot uses jinja2 for templating, the jinja2 homepage has some nice documentation. This is where the non-html statements come from. I found google's chromium buildbot to be a good starting point, when learning about buildbot customization.
http://buildbot.net/buildbot/docs/0.8.7/developer/webstatus.html
http://jinja.pocoo.org/docs
http://src.chromium.org/viewvc/chrome/trunk/tools/build/masters/master.chromium/templates/

Support for live preview of Haml in Coda or Espresso?

I just discovered the beautiful Haml and Sass, and want to develop in these languages but with live previews. Coda and Espresso both allow for beautiful live previews of HTML files, but previews of an Haml file simply show it as plain text.
While there exist sugars for Espresso that add syntax highlighting, which is nice, I would like something that automatically compiles Haml files to HTML, and then lets me preview that instead of Haml.
Does anything like this exist for either Coda, or Espresso, or for any other web development tool out there?
(If it makes a difference, I'm not developing for Ruby on Rails, I'm making a static website, so the Ruby on Rails plugin shouldn't help AFAIK.
Software I tried out were StaticMatic and Middleman. StaticMatic's development seems discontinued, and for some reason MiddleMan refuses to work after creating my initial directory structure. Maybe I'm using it wrong.)
I don't use Espresso, so no comment there. However, Coda does not provide any support for Haml or Sass that I can find. I've been closely following the Coda forums, as I am a paid user, and it looks as though a 2.0 version is forthcoming. Who knows, perhaps that'll be included.
For now, since you're not using Ruby on Rails, I might suggest TextMate. It doesn't do Haml or Sass "right out of the box", but it can be configured to do so using "Bundles."
Installing HAML bundle for TextMate is a primer on how to setup TextMate for Haml/Sass, and I suspect there are others.
That said, for roughly the cost of TextMate you can purchase RubyMine ($69), which does both Haml (via RubyGem) and Sass (via Plugin), and can also handle running Sass --watch internally. I know you're not using Ruby, so maybe the idea of using a tool made primarily for Ruby doesn't appeal, but it does work in both the Haml and Sass environments very nicely.
The third option would be BBEdit, which can also handle both Haml and Sass. Some information on the plugin for BBEdit is in BBEdit-Codeless-Language-Module-for-HAML-SASS.
I hope this helps.
P.S.: I'm a paid user on all the platforms I mentioned. While I use RubyMine as my primary tool, I find that TextMate still gets a lot of use when I'm programming and need a quick, friendly window to examine code in. I used to use BBEdit when I needed to do complex regular expression-style search and replacements, but then I discovered how to do the same thing in TextMate, so BBEdit is sort of collecting dust. Coda? It looks pretty, but doesn't get the job done so much any more (though Panic's Transmit is still very much a core application).
There are two plugins for Coda 2 that I am aware of:
Coda-Sass-Plug-in is available from GitHub and allows you to save out your scss files to css. I worked for me though I wasn't completely happy with needing to refresh multiple tabs all the time.
LessCSS is available from incident57 dot com. Although I was never able to make it work, it lead me to CodeKit (CodeKit has been mothballed due to production of CodeKit).
CodeKit has the ability to watch folders and generate css files from sass or less when they are saved. It also has the ability to handle Stylus, Haml, Javascript, CoffeeScript, Jade, Slim and Kit.
OK, for anyone else looking for an answer to this, I decided to go along with a different solution. I'm using my normal editors, along with 'serve', a Ruby gem that runs a web server using WEBrick, and automatically compiles any files which it detects has changed. This includes HAML, Sass, Slim, Markdown, etc. files. I'm going to be using either Coda's live preview, or the minimalist browser called Playground, which eliminates the need to press refresh when the local file it is displaying changes.
This workflow is nice for now, although it doesn't have any built-in method to build the entire site into a static site when I'm done and want to deploy. This is a feature in middleman, but middleman still refuses to run because a dependency of it, thin, refuses to work on 64 bits. I might have to manually compile all the files using the terminal command, and hope the Haml interpreter can handle combining template files with each file, which I seriously doubt at this stage. This limitation and thus the continued dependence on 'serve' might force me to consider one of the other applications out there, listed on the page Haml Sucks for Content.

use Template Toolkit for plain .html files?

Right now I have a site that uses Perl and Template Toolkit (using the Template module) for pages that require calculation and/or database access but regular HTML files for the the rest of the pages. However, I have discovered that it would be nice if I had access to templating goodness for even the "plain HTML" pages, if only for the convenience of "including" standard headers and footers, etc.
What is the easiest way to introduce this with the least amount of disruption to the current site? (i.e. I would prefer not to have to change all the filenames and links).
The two approaches that spring to my mind are:
Process the static files off-line using ttree
Write some sort of mod_perl hander to run all .html files through TT before outputting

Convert Sandcastle Help File Builder Output (Web site) to MediaWiki format

I need to
convert my Sandcastle Help File
Builder (SHFB) output that is a Web
site (HTML) to Media wiki format
Find a way to transfer/include the
converted pages directly into the
MediaWiki we have set up.
Any ideas? we have over 1000 pages of HTML files inthe Website (output of SHFB).
I thought of using a html2wiki converter ..I could think of looking around for a script to convert those 1000 pages into wiki format... that could take care of (1).
But I would still be left with the block in the last bit of the pipeline - how to feed converted pages directly into the Wiki?
Take a look at Help Server. It allows to publish .CHM / .HxS produced by any tool (including Sandcastle) on the web and provides URL-based integration API.
We use MediaWiki as well. A set of templates for it allows us to create links to class reference shared by Help Server. Some examples of such links can be found right on that page.
Note that DataObjects.Net Help web site is running on Help Server 2.X, but the newest one is 3.X (example web site is here).
I did some work with ingesting existing material from several sites into a comprehensive Wiki. It did not involve Sandcastle, but if you're dealing with HTML it shouldn't matter much. html2wiki extensions are out there, and from what I have read they can solve a lot of problems. I needed a little more control over each node in the DOM, so i used Simple HTML DOM Parser. It's in PHP and was easily dropped into Mediawiki's includes.
For creating the new pages, I ended up writing a small script that uses Mediawiki's Article class, specifically the doEdit function. this allows you to create new articles programatically, without user interaction. Of course, you'd want to be careful with this... The last thing you need is to create 1000 pages that are no good and have to be deleted. But perhaps this will help get you going.