DokuWiki with SVN: how and what should be under source control - dokuwiki

I want to store my documentation under SVN source control.
In DokuWiki settings there is
Directory for saving data '.../apps/dokuwiki/data'
DokuWiki stores all data inside text files under '.../apps/dokuwiki/data' folder. There are many stuffs there including indexes caches etc. It seems that I only need the 'pages' folder.
How can I move the 'pages' folder inside my SVN folders and configure the DocuWiki to use pages from there?

$conf['datadir'] can be used in conf/local.php to set the page directory independently from the rest of the directories in data. You probably want to use $conf['mediadir] for uploaded images and files as well and maybe $conf['metadir'] for saving page metadata.

Here's an example of what I set mine to:
$conf['datadir'] = './my-data/pages/';
$conf['mediadir'] = './my-data/media/';
$conf['metadir'] = './my-data/meta/';
N.B. Be sure to use 'datadir' (not 'pagedir') as noted in the comments to the earlier answer.
You may also want to configure your attic:
$conf['olddir'] = './my-data/attic/';
This makes management under svn more complicated, as you have to add attic files all the time, but it preserves change history across developers. This depends a little more on your installation though; if you regularly clean your attic you wouldn't want to do this.

Related

Can I use symbolic links in Dokuwiki's page files?

I'm planning to try using dokuwiki to manage my large collection of notes, and one of the major attractions is its flat file basis that'll allow me to edit via scripts etc. I had a question - suppose a page's material fits into multiple namespaces. If I were to create the file in one namespace and then create symlinks in the other namespace directories, would that work? Or would that screw up revisions etc?
Yes, you can do that. But yes, this will mess with your revisions a bit:
when DokuWiki saves a page, it copies the data of the old page to the attic
the name of the attic file is the same as the page that was edited, but with a timestamp appended
because new attic files are created you can't work with symlinks in the attic
Imagine you have the following setup:
data/pages/original.txt
data/pages/copy.txt -> original.txt
You now can edit the pages original and copy in your wiki and they will both always be the same. However old revisions of the pages will be split between the two, depending on which page you edited.
Instead of messing with file level consider
Include plugin to share content between pages.
Creation of some 'commons' namespace for such pages to be DRY.
Namespace templates (+ additional plugin).
Pulling content from page side instead of pushing it to pages. This might be good to start with. You can always include some php code or even write your own plugin.

Magento how do I override/alter template/payment/form/purchaseorder.phtml file

I need to add some text to this file [template/payment/form/purchaseorder.phtml], for a particular store within clients' magento site. When I make a change to the purchaseorder.phtml file, it changes the text on all the stores. So I need to somehow customize this for one store in particular.
I have read comments on several sites, some mention changing the local.xml, change the config.xml, make changes in admin panel, but this such a small change, I don't want to disrupt anything by going overboard.
I need to extend the functionality on the backend so this change can be made for a particular store or stores. the sites has five stores built into the one install and for now I need to make the above change to just one store.
I think I need to somehow add a PO field Heading and an "Additional Text" option to the Purchase order section in image two. is this correct, if so how do I do this?
Could someone point me in the right direction to making this type of change please.
Note: I can't do the create directory structure, copy files, change needed files option
This is magento 1.7
Copy purchaseorder.phtml file from base/default directory then paste it in your current template. Now you can alter content of it purchaseorder.phtml in your current directory, it wont affect the base file.Like below,
Copy from
app/design/frontend/base/default/template/payment/form/purchaseorder.phtml
Paste to
app/design/frontend/base/current_theme/template/payment/form/purchaseorder.phtml
When you override a section, the folder structure should resemble the default template folder structure like current_theme/template/form/ payment/purchaseorder.phtml .
sorry for bad english.

How do I edit files in place that were uploaded to Moodle?

I would like a better workflow for debugging uploaded SCOs. As things are, I must edit a file in the activity, repackage, upload, and test. Often, I just need to change a single line of code. It would be VERY nice to be able to edit that file, that line of code, on the server. So far, all I've found is that Moodle manages the files, so it seems impractical to locate and decipher the renamed files after upload.
Is there a way to configure Moodle so that it doesn't rename and relocated files in SCOs upon extraction? Actually, I'm open to any suggestions on the best, fastest workflow for debugging SCOs.
Problem background
Since Moodle 2.0, files are no longer stored on server in the conventional /this/is/the/path/to/my.file way. Instead, files are rehashed and stored in Repositories (i.e. spread all over the moodledata folder as a collection of seemingly random data). This increases security and cross-OS compatibility but complicates stuff for people who would like to simply upload a SCORM zip package via FTP. Here's more information on file handling in Moodle 2.0
Path to the soluton
Let's locate the file you want to update, then update it.
Run phpmyadmin, go to mdl_files table, find your file by name in the filename field (let's say it's portrait.jpg)
Look at the contenthash field, it'll look like abcde1234567890. This means your file is stored in moodledata/filedir/ab/cd/ folder under the name abcde1234567890.
Rename the updated portrait.jpg to abcde1234567890, upload and overwrite.
Go back to phpmyadmin and update the filesize field in record for portrait.jpg with the size of the updated file.
Obviously, this process can be automated. You'll have to write a script that allows you to upload a file, then it'll search for that file in mdl_files, save it to the correct folder and update all fields accordingly.
Alternative idea
Enable external package type (and also enable 'Update on every launch'). Go to Site administration / Plugins / Activities / SCORM and check the box down below. Now you'll be able to launch SCORM packages directly from another server, so Moodle won't mess with it. Of course, you can run in other (probably cross-domain related) problems.
Sergey's answer is very good, with one caveat:
In his example with the contenthash of abcde1234567890, the file is stored in the moodledata/filedir/ab/cd/ folder under the name abcde1234567890. Moodle uses the full contenthash to name the file.

Embedding a dynamic file using the "view file" macro

The view file macro allows embedding documents (.ppt, .pdf, etc) on a Confluence wiki page. Limitation is, documents must be on attachments.
So question, is there a way to load dynamically a file located into an SCM's deposit?
P.S. Current SCM: Perforce.
UPDATE: As I see, there is no official Perforce plugin.
You may of course include a link to that file, if Perforce provides a way to link items. We use that a lot, to include content that is stored in Subversion, and document the standing, the usage, ... in Confluence then. The user has to click on that link to get that file, but I think it is necessary anyway, because your authorization rules are not known to Confluence.

How do you structure your website content?

Do you try to keep it simple and have a root folder and then 1 folder for images, javascript, flash, etc? What do you normally call your folders? Do you give your files naming conventions?
not a standard way.. but from my experience, I come up with this structure:
root/
-> images/
-> <subfolder>
-> upload
-> js/
-> css/
-> data/
-> docs/
-> download/
-> mme/
-> subpages/
-> temp/
-> siteadmin/
root: all 1st level file located there
images: all images. if images for subfolder, then another level there with the same name. upload is for uploaded images.
js: javascript
css: css
data: some raw data if needed
docs: word doc or pdf for download
download: something that for ppl to downlaod...
mme: other multimedia files. e.g. flash, movie.. soudn clips.etc.
subpages: 2 or subsequent level pages. organized in different folders
temp: any testing page store there. private, not public.
siteadmin: if you have an admin site.
I keep it simple, but then my web site doesn't need things that cause complexity. In general, each web page has a name that corresponds to a folder on disk and that folder contains all of the things needed to display that page. The hierarchy of the web site matches the hierarchy on disk.
It depends on the project but I generally go with js/, img/, and fl/. Sometimes I divide root into code/ and content/, but I think that may be overkill. As far as naming convention, I usually have my images perpended with the name of the page they are generally embedded on. If they are on every page, I go with something like global_ or all_. I hope that helps...
If there are many images then a folder for them is useful, however I tend to have 1 JS file, 1 or 2 CSS.
The most useful thing I think is to mod_rewrite all the pages, like stackoverflow does.
It really depends on how many pages your site has. Early on, it may seem like a good idea to simply drop all the pages in the root. Later on, when you have 120 unrelated files sitting there, you may start kicking yourself.
I tend to put together a simple 1-deep hierarchy, broken down by site area. /forums, /photos, /account, etc. I've learned from experience that your page count will tend to grow a lot higher than you anticipated. And I've learned from experience that it just plain sucks to move pages out of the root and into a sensible structure once they have external links. Best do it right from the start.
root
+-+ include
+-- cache
+-- script
+-- css
+-- images
This directory is of course not externally acessible.
Why all under include? Because none of these media files are served directly. They all go through a script that:
Compacts all the CSS files into one file;
Compacts all the Javascript into one minified file;
Writes those versions to the cache directory;
Timestamps css, js and image files and sets the expires header to far in the future;
Keeps cached copies of the compacted js and css files in the cache directory; and
All references to those files goes through an auto version function that uses the last modified time to change the URL to control when the client gets a new copy (eg /css/screen.1234567890.css), similar to what SO does with its query string on such files.
The above can speed up a site significantly.
The rest of the directory structure will mirror the menu structure of the site. If there is an "Orders" top level menu items with a submenu then you can bet you'll find an accounts directory under the root directory.
All this makes the site very, very predictable if someone else needs to come and maintain it. It's extremely important that someone else is able to find their way around.