Difference between revisions of "Notes"

From Critiques Of Libertarianism
Jump to: navigation, search
Line 1: Line 1:
== Implementation Tricks==
+
== Languages ==
 +
Initially, I thought using mediawiki would be a very easy way to build my site.  But it turned out that it really called upon many of my nerdy skills.
 +
 
 +
# Wikitext -- the mediawiki markup language; the bulk of the work is in this.
 +
# HTML -- needed intermittently in conjunction with wikitext.
 +
# DPL -- Dynamic Page List, an extension that allows more complicated lists than mediawiki categories.
 +
# PHP -- mediawiki is implemented in and configured with PHP.
 +
# javascript -- I use it primarily for forms that generate wikitext for new articles.
 +
# XML -- I use dumps from Delicious Library in XML.  Typing in hundreds of books is much more tedious than scanning them.
 +
# Python -- I use it primarily to generate wikitext for new articles about books from XML dumps.
 +
# Various extensions: DPL, Nuke, Interwiki, ParserFunctions, StringFunctions
 +
# CSS -- not yet used, but fundamental to the display of a wiki.
 +
 
 +
== Implementation Tricks ==
 
Producing indexes using categories is simple, but had several ugly drawbacks:
 
Producing indexes using categories is simple, but had several ugly drawbacks:
 
* Their titles all start with "Category:".
 
* Their titles all start with "Category:".
* Categories tend to be single level.
 
 
* Categories do not let you add extra information beyond the title of a page.
 
* Categories do not let you add extra information beyond the title of a page.
 
* Categories do not let you mix wiki pages with external links.
 
* Categories do not let you mix wiki pages with external links.
Line 9: Line 21:
  
 
I solved these problems with several tricks.
 
I solved these problems with several tricks.
* Extensions ParserFunctions, StringFunctions, DynamicPageList.
+
* Extensions ParserFunctions, MyVariables, DynamicPageList.
 
* [[:Template:DES]] which allows me to associate descriptions with each page.
 
* [[:Template:DES]] which allows me to associate descriptions with each page.
 +
* [[:Template:URL]] which allows me to optionally associate an external URL with a page.
 
* Index templates [[:Template:List]] and [[:Template:Quotations]].  These let me list categories with DPL and display descriptions with each page.  If a page is for an external link, that link is used rather than the internal wiki link.
 
* Index templates [[:Template:List]] and [[:Template:Quotations]].  These let me list categories with DPL and display descriptions with each page.  If a page is for an external link, that link is used rather than the internal wiki link.
* A number of templates that associate other data with pages, such as external links ([[:Template:URL]]), text from external links ([[:Template:Text]]) and citation information.
+
* Link templates, [[:Template:Link]], let me treat internal and external links uniformly, relying on the single URL stored on a page. 
* A few templates create debugging categories, which are hidden with __HIDDENCAT__.
+
* A number of templates that associate other data with pages, such as external links ([[:Template:URL]]), text from external links ([[:Template:Text]]) and citation information.  External URLs exist as only one copy on one page, and are retrieved with templates.
 +
* A few templates create debugging categories, which are hidden with <nowiki>__HIDDENCAT__</nowiki>.
 
* Page building services written in JavaScript that automatically construct wiki page code and open the page to paste it into.  [[http://dl.dropbox.com/u/20086520/js/new_external.html Indexable Page/Quote]]
 
* Page building services written in JavaScript that automatically construct wiki page code and open the page to paste it into.  [[http://dl.dropbox.com/u/20086520/js/new_external.html Indexable Page/Quote]]
* A one-line hack to the mediawiki OutputPage.php code that makes the categories links at the bottom of each page go directly to a main namespace page instead of a category namespace page.  Switch <code>$title = Title::makeTitleSafe( NS_CATEGORY, $category );</code> to use <code>NS_MAIN</code>Thus, no sending people to category pages or having category pages redirect to regular pages.  You can still go to Category pages directly.
+
* A short hack to the mediawiki OutputPage.php code that makes the categories links at the bottom of each page go directly to a main namespace page instead of a category namespace page when the main namespace page exists.   
 +
<code>
 +
# MRH Make category listings at bottom of page go directly to page with the
 +
# MRH name of the category.  Can still use the Go box to get to the categories.
 +
# MRH                          $title = Title::makeTitleSafe( NS_CATEGORY, $category );
 +
                                $title = Title::makeTitleSafe( NS_MAIN, $category );
 +
                                if ( ! $title->isknown() ) {
 +
                                        $title = Title::makeTitleSafe( NS_CATEGORY, $category );
 +
                                }
 +
# MRH end of changes
 +
</code>
 +
Thus, no sending people to category pages or having category pages redirect to regular pages.  You can still go to Category pages directly.
  
 
The end result is:
 
The end result is:
Line 23: Line 48:
 
* Broken external links can be automatically looked up in the internet archive from the in-wiki page.
 
* Broken external links can be automatically looked up in the internet archive from the in-wiki page.
 
* External text can be searched within the wiki because it is in the database.
 
* External text can be searched within the wiki because it is in the database.
 +
* Categories can be combined for listing by making them subcategories of each other.  Category:Friedrich Hayek is a subcategory of Category:Friedrich von Hayek, so listing the latter includes the former.
 +
 +
== Interwiki ==
 +
* http://www.mediawiki.org/wiki/Extension:SpecialInterwiki
 +
* [[Special:Interwiki]] to edit interwiki table
 +
* Use <nowiki>[[wikipedia:pagename]]</nowiki>
 +
* I use huben, hybridize, and critiques for mine
  
 
== Other Notes ==
 
== Other Notes ==
 +
 +
When upgraded to version > 1.17:
 +
* http://en.wikipedia.org/wiki/Wikipedia:NavFrame
 +
* http://en.wikipedia.org/wiki/Help:Collapsing
 +
* http://www.mediawiki.org/wiki/Manual:Collapsible_elements to revise structure to collapse and expand
 +
<code>
 +
<div class="toccolours mw-collapsible">
 +
Header
 +
<div class="mw-collapsible-content">
 +
<div class="toccolours mw-collapsible mw-collapsed">
 +
; First
 +
: test
 +
<div class="toccolours mw-collapsible-content">
 +
;sfgarg
 +
:sfwf
 +
;regregter
 +
:ertwert
 +
</div>
 +
</div>
 +
<div class="toccolours mw-collapsible mw-collapsed">
 +
; Second
 +
: test
 +
<div class="toccolours mw-collapsible-content">
 +
;sfgarg
 +
:sfwf
 +
;regregter
 +
:ertwert
 +
</div>
 +
</div>
 +
</div>
 +
</div>
 +
</code>
  
 
Investigate using:
 
Investigate using:

Revision as of 20:06, 10 March 2014