MojoMojo::Formatter::File(3pm) User Contributed Perl Documentation MojoMojo::Formatter::File(3pm)NAME
MojoMojo::Formatter::File - format file as XHTML
DESCRIPTION
This formatter will format the file argument as XHTML.
Usage: {{file TYPE filename}}
{{file Text uploads/Files/test.txt}}
TYPE is a plugin present in Formatter/File/ directory.
Currently there are only three: Pod, DocBook and Text
The plugin TYPE format only the file which the extension match with 'can_format' method. Respectively pod, xml and txt for existing
plugins.
For security reasons the path of file must be include in 'whitelisting' directory. You can use path_to(DIR) to describe directory in
mojomojo.conf:
Just an example to view the test pod file t/var/files/test.pod :
Add this to mojomojo.conf :
<Formatter::Dir>
prefix_url /myfiles
whitelisting __path_to(t/var/files)__ </Formatter::Dir>
To see the pod content formatted in xhtml, write in the text area:
{{file Pod path_to(t/var/files)test.pod}}
To show recursively all files of directory see script/util/dir2mojomojo.pl script. To test it:
# start mojomojo
./script/mojomojo_server.pl
# run dir2mojomojo script
./script/util/dir2mojomojo.pl --dir=~/dev/mojomojo/t/var/files/ --url=/myfiles
Connect to http://server:3000/myfiles/
METHODS
format_content_order
Format order can be 1-99. The File formatter runs on 92.
format_content
Calls the formatter. Takes a ref to the content as well as the context object.
plugin
Return the plugin to use with file attachment
format
Return the content formatted
checkplugin
Return 0 if plugin exist
checkfile
Directory must be include in whitelisting
SEE ALSO
MojoMojo,Module::Pluggable::Ordered
AUTHORS
Daniel Brosseau <dab@catapulse.org>
LICENSE
This module is licensed under the same terms as Perl itself.
perl v5.14.2 2010-04-07 MojoMojo::Formatter::File(3pm)
Check Out this Related Man Page
MojoMojo::Formatter::CPANHyperlink(3pm) User Contributed Perl Documentation MojoMojo::Formatter::CPANHyperlink(3pm)NAME
MojoMojo::Formatter::CPANHyperlink - automatically hyperlink CPAN modules when using the syntax {{cpan Some::Module}}
DESCRIPTION
Normally, to hyperlink to a CPAN module, you'd write:
[MojoMojo::Formatter::CPANHyperlink](http://search.cpan.org/perldoc?MojoMojo::Formatter::CPANHyperlink)
This plugin lets you write just
{{cpan MojoMojo::Formatter::CPANHyperlink}}
Just like POD, it supports adding a section after the module name:
{{cpan Catalyst::Manual::Cookbook/Deployment}}
will create a link to
http://search.cpan.org/perldoc?Catalyst::Manual::Cookbook#Deployment
Sections can contain any characters, except two consecutive closed braces:
{{cpan Catalyst::Test/($res, $c) = ctx request( ... ); }}
will link to
http://search.cpan.org/perldoc?Catalyst::Test#($res,_$c)_=_ctx_request(_..._);
In anticipation of future plugin syntax, you can optionally add a trailing slash
{{cpan Some::Module/Section /}}
METHODS
format_content_order
The CPANHyperlink formatter has no special requirements in terms of the order it gets run in, so it has a priority of 10.
format_content
Calls the formatter. Takes a ref to the content as well as the context object.
SEE ALSO
MojoMojo and Module::Pluggable::Ordered.
AUTHORS
Dan Dascalescu, <http://dandascalescu.com>
LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2010-04-07 MojoMojo::Formatter::CPANHyperlink(3pm)
hi,
i encounter a quite a new things for me.
lets sat my test.txt modified date is 6th of July 2005.
then i execute the following command:
"cp test.txt testfolder/test.txt"
when i go to execute "ls -l" command...
the test.txt modified date become today date!
but if i execute:
... (5 Replies)
I need to manipulate an existing file, test.txt. The length of record inside test.txt is 500 with multiple columns. I need to find out the position 145 and insert 10 blank spaces. The test.txt file could be multiple line.
Thanks, (5 Replies)
Hi,
I have a file and the content looks like this:
line1
line2
File #5 : found
'/u01/testing.txt'
line5
line6
line7
File #12 : found
'/u01/testabc.txt'
line10
line11
I want to write a bash script to give me the output:
The file 5 is '/u01/testing.txt'
The file 12 is... (6 Replies)
Hi!
Im trying to write a script in ksh that creates a single txt-file from specific content in several other txt-files.
From these files I want to extract all text after 'WORD' and before '=', regardless of number of lines and other content.
I have tried cat and guess I need... (7 Replies)
I am running my script from "/abc/" this path and it has no ".csv files" but has a ".txt" files namely temp1.txt
My script goes as below, wherein it is suppose to find files with *.txt extension and *.csv extension in another path namely "/abc/xyz/":
#!/bin/ksh
PATH1="/abc/xyz/"
value="*.csv... (7 Replies)
I need to write a script to test a nsort c program. I have written 8 .txt files with different cases. Also 8 .txt files with expected outcome. The shell I have written always "test pass" for the first case but always "fail" for the rest... Here is a portion of my code (as I still don't know how to... (5 Replies)
I have a file in multiple directory which has some records in the following format
File: a/latest.txt , b/latest.txt, c/latest.txt ->
Name=Jhon
Age=27
Gender=M
Street=LA Road
Occupation=Service
I want to generate a csv file from the above file as follows
File: output.csv ->
... (9 Replies)
In the Directory all the Files are following format.
Filename_yyyymmdd_numbers.txt
eg.
file_name_20120106_015802.txt .
I want to write the Shell script to rename all the file to
file_name.txt.in the directory.
Thanks
Mani (5 Replies)
Hello,
i have a problem. I must write a script, which wants 2 arguments.
for example:
./test.sh x.txt y.txtit must be write x.txt in y.txt
and when i give 1 or no argument like
/.test.sh x.txtmust this give a error message like: SYNTAX <inputfile> <outputfile>
my solution is... (5 Replies)
Please suggest a method (in c shell or any other shell) to implement following:
-To read file1.txt (sample file1 given below)
-To save name field in a variable <name>
-To save parameter field in a variable <parameter>
for ex. let a line in file1.txt be :
bill height weight
the extracted... (12 Replies)
So I worked out a script for Mac OSX from an existing script. This script checks the versionnumber of a plugin and a package. If the plugin version is different from the package it has to update the plugin. The script works fine but the final check fails.
Here is my script:
#compare version... (6 Replies)
Their are lot of files under the dir prod. I would like to get the file name which contain the word hello.
File name firstprog.txt
Dir structure : t01/Admin/prod
I am using the below and does not work
/t01/Admin# grep -l hello /t01/Admin/* ( I am in the Admin dir and grep)
... (6 Replies)
Why does not work a cd in a shell schript file.
How do you get to run it?
I use these code:
#!/bin/sh
cd workspace
array=($(ls -d */))
echo ${array}
But it doesn't change to workspace
editby bakunin: please user CODE-tags as required by the rules. Thank you. (12 Replies)
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)