Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use list of allowed transforms #38

Open
petermr opened this issue May 8, 2016 · 2 comments
Open

Use list of allowed transforms #38

petermr opened this issue May 8, 2016 · 2 comments
Assignees

Comments

@petermr
Copy link
Member

petermr commented May 8, 2016

  • Enumerate the allowed transforms in norma.
  • Check that input argument (e.g. foo in --transform foo) is allowed
  • provide default input and output files for each transform
@petermr petermr self-assigned this May 8, 2016
@petermr
Copy link
Member Author

petermr commented May 8, 2016

have created Type in NormaTransformer.

    public enum Type {
        HTMLUNIT("htmlunit", null, CTree.FULLTEXT_HTML, null, CTree.FULLTEXT_XHTML),
        JSOUP("jsoup", null, CTree.FULLTEXT_HTML, null, CTree.FULLTEXT_XHTML),
        TIDY("tidy", null, CTree.FULLTEXT_HTML, null, CTree.FULLTEXT_XHTML),

        HOCR2SVG("hocr2svg", "image/", CTree.PNG, "svg/", CTree.SVG),
        CSV2HTML("csv2html", "table/", CTree.CSV, "table/", CTree.HTML),
        PDF2HTML("pdf2html", null, CTree.PDF, null, CTree.HTML),
        PDF2IMAGES("pdf2images", null, CTree.PDF, "image/", CTree.PNG),
        PDF2SVG("pdf2svg", null, CTree.PDF, "svg/", CTree.SVG),
        PDF2TXT("pdf2txt", null, CTree.PDF, null, CTree.TXT),
        TEX2HTML("tex2html", null, CTree.TEX, null, CTree.HTML),
        TXT2HTML("txt2html", null, CTree.TXT, null, CTree.HTML);

        public String inputFilename;
        public String outputFilename;
        public String transform;
        public String inputDirName;
        public String outputDirName;

        private Type(String transform, String inputDir, String inputFilename, String outputDir, String outputFilename) {
//
        }

Thus CSV2HTML is:

        CSV2HTML("csv2html", "table/", CTree.CSV, "table/", CTree.HTML),

which gives parameter, default inputDir, input suffix, default outputDir, outputSuffix.

This allows default for directory names

@petermr
Copy link
Member Author

petermr commented May 10, 2016

Discussed at length with @tarrow ...

Agreed to redesign as:

--transform type param/s

where type is (say) any of the examples above (csv2html)...
Historically

--transform foo.xsl

was shorthand for

--transform xml2html foo.xsl

so let's make it explicit and deprecate the type-less command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant