1 {-# LANGUAGE AllowAmbiguousTypes #-}
2 {-# LANGUAGE DuplicateRecordFields #-}
3 {-# LANGUAGE ExistentialQuantification #-}
4 {-# LANGUAGE FlexibleContexts #-}
5 {-# LANGUAGE OverloadedLists #-}
6 {-# LANGUAGE OverloadedStrings #-}
7 {-# LANGUAGE TupleSections #-}
8 {-# LANGUAGE TypeApplications #-}
9 {-# LANGUAGE TypeFamilies #-}
10 {-# OPTIONS_GHC -fno-warn-orphans #-}
13 -- import Data.Reflection (reify, Reifies(..))
14 -- import qualified Data.Text.IO as Text
15 import Control.Applicative (pure)
16 import Control.Monad (Monad(..), when)
18 import Data.Default.Class (Default(..))
19 import Data.Either (Either(..))
20 import Data.Eq (Eq(..))
21 import Data.Foldable as Foldable (Foldable(..))
22 import Data.Function (($), (.))
23 import Data.Functor ((<$>))
24 import Data.List.NonEmpty (NonEmpty(..))
26 import Data.Maybe (Maybe(..), fromMaybe, maybe)
27 import Data.Monoid (Monoid(..))
28 import Data.Ord (Ord(..))
29 import Data.Semigroup (Semigroup(..))
30 import Data.String (String, IsString(..))
31 import Data.Void (Void)
32 import GHC.Exts (IsList(..))
33 import Prelude (error)
34 import System.FilePath as FilePath
35 import System.IO (IO, FilePath)
36 import Text.Show (Show(..))
37 import qualified Data.ByteString as BS
38 import qualified Data.Char as Char
39 import qualified Data.List as List
40 import qualified Data.Map.Strict as Map
41 import qualified Data.Set as Set
42 import qualified Data.Text as Text
43 import qualified Data.Text.Lazy as TL
44 import qualified Data.Text.Lazy.IO as TL
45 import qualified Data.TreeSeq.Strict as Tree
46 import qualified Data.Version as Version
47 import qualified Language.Symantic.RNC.Write as RNC
48 import qualified Paths_hdoc as Hdoc
49 import qualified System.Directory as IO
50 import qualified System.Environment as Env
51 import qualified System.IO as IO
52 import qualified Text.Blaze.Renderer.Utf8 as Blaze
53 import qualified Text.Blaze.Utils as Blaze
54 import qualified Text.Megaparsec as P
56 import qualified Hdoc.Utils as FS
57 import qualified Hdoc.TCT as TCT
58 import qualified Hdoc.TCT.Write.HTML5 as TCT
59 import qualified Hdoc.TCT.Write.Plain as TCT
60 import qualified Hdoc.TCT.Write.XML as TCT
61 import qualified Hdoc.DTC.Read.TCT as DTC
62 import qualified Hdoc.DTC.Sym as DTC
63 import qualified Hdoc.DTC.Write.HTML5 as DTC
64 import qualified Hdoc.DTC.Write.XML as DTC
65 import qualified Text.Blaze.DTC as Blaze.DTC
66 import qualified Text.Blaze.HTML5 as Blaze.HTML5
68 import Language.Symantic.CLI hiding (main)
69 import qualified Language.Symantic.CLI as CLI
70 import qualified Language.Symantic.Document.Term.IO as Doc
72 import qualified Language.Symantic.CLI.Plain as Plain
73 import qualified Language.Symantic.CLI.Help as Help
74 import qualified Language.Symantic.CLI.Read as Read
77 version = "hdoc-" <> TL.pack (Version.showVersion Hdoc.version)
83 readArgs lang args >>= \case
85 Just (Left err) -> onExit err
86 Just (Right cmd) -> onCommand cmd
91 Lang -> [String] -> IO.IO (Maybe (Either (Exit (Doc d)) Command))
94 Read.readArgs (cli (loqualize lang) lang) $
95 Read.Args $ Read.Arg <$> ("hdoc":args) of
96 Right a -> return $ Just $ Right a
98 case P.bundleErrors err of
99 P.FancyError o es :| _ ->
100 case Set.toList es of
101 [P.ErrorCustom (Read.ErrorRead e)] ->
104 IO.hPutStr IO.stderr $
105 P.parseErrorPretty @Read.Args @(Read.ErrorRead Error) $
106 P.FancyError o $ Set.singleton $ P.ErrorCustom $
109 _ -> return $ Just $ Left e
111 P.TrivialError o e es :| _ -> do
112 IO.hPutStr IO.stderr $
113 P.parseErrorPretty @Read.Args @Void $
114 P.TrivialError o e es
121 | Exit_License (Loq d)
124 instance Show (Loqualization q) where
125 show _ = "Loqualization"
127 onExit :: Exit (Doc Doc.TermIO) -> IO ()
128 onExit (Exit_Help d) =
129 Doc.runTermIO IO.stdout $
130 Doc.withBreakable (Just 80) (runDoc d) <>
132 onExit Exit_Version =
134 onExit (Exit_License (Loqualization l)) =
135 Doc.runTermIO IO.stdout $
138 onExit Exit_Error{} =
143 = Error_Locale String
148 = Command_Source CommandSource
149 | Command_Compile CommandCompile
150 | Command_Schema CommandSchema
153 onCommand :: Command -> IO ()
154 onCommand cmd@(Command_Source CommandSource{..}) = do
155 IO.hPrint IO.stderr cmd
156 TCT.readTCT source_input >>= \case
157 Left err -> error $ show err
159 when source_dump_tct $
160 FS.writeFile (source_output-<.>"tct.dump") $
161 TL.pack $ Tree.prettyTrees tct
162 case source_format of
163 CommandSourceFormat_Plain ->
164 FS.writeFile source_output $
166 CommandSourceFormat_HTML5 ->
167 FS.withFile source_output IO.WriteMode $ \h ->
168 Blaze.renderMarkupToByteStringIO (BS.hPutStr h) $
170 onCommand cmd@(Command_Compile cmdComp@CommandCompile{..}) = do
171 IO.hPrint IO.stderr cmd
172 TCT.readTCT compile_input >>= \case
173 Left err -> error $ show err
175 when compile_dump_tct $ do
176 FS.writeFile (compile_output-<.>"tct.dump") $
177 TL.pack $ Tree.prettyTrees tct
178 let xml = TCT.writeXML tct
179 when compile_dump_xml $ do
180 FS.writeFile (compile_output-<.>"xml.dump") $
181 TL.pack $ Tree.prettyTrees xml
182 case DTC.readDTC xml of
184 FS.removeFile $ compile_output-<.>"deps"
185 error $ List.unlines $ Foldable.toList $ P.parseErrorPretty <$> P.bundleErrors err
187 when compile_dump_deps $ do
188 writeDependencies cmdComp tct
189 when compile_dump_xml $ do
190 FS.writeFile (compile_output-<.>"dtc.dump") $
192 case compile_format of
193 CommandCompileFormat_XML ->
194 FS.withFile compile_output IO.WriteMode $ \h ->
195 Blaze.prettyMarkupIO Blaze.DTC.isInlinedElement (BS.hPutStr h) $
196 DTC.writeXML compile_locale dtc
197 CommandCompileFormat_HTML5{..} -> do
198 config_css <- installFile compile_html5_output_css $ "style"</>"dtc-html5.css"
199 config_js <- installFile compile_html5_output_js $ "style"</>"dtc-html5.js"
200 let conf = DTC.Config
203 , DTC.config_locale = compile_locale
204 , DTC.config_generator = version
206 FS.withFile compile_output IO.WriteMode $ \h -> do
207 html <- DTC.writeHTML5 conf dtc
209 Blaze.HTML5.isInlinedElement
213 installFile out name = do
214 dataDir <- Hdoc.getDataDir
215 let src = dataDir</>name
217 Nothing -> Right <$> FS.readFile src
218 Just "" -> return $ Left ""
220 IO.createDirectoryIfMissing True $ FilePath.takeDirectory dst
223 onCommand Command_Schema{} =
224 TL.hPutStrLn IO.stdout $
225 RNC.writeRNC DTC.schema DTC.schema
227 writeDependencies :: CommandCompile -> TCT.Roots -> IO ()
228 writeDependencies CommandCompile{..} tct =
229 let dir = FilePath.takeDirectory compile_input in
230 FS.writeFile (compile_input-<.>"deps") $
231 foldMap (TL.pack . (("\n" <>) . FilePath.normalise))
232 ((dir </>) <$> TCT.dependencies tct) <>
235 -- ** Type 'CommandSource'
238 { source_output :: FilePath
239 , source_dump_tct :: Bool
240 , source_format :: CommandSourceFormat
241 , source_input :: FilePath
245 -- *** Type 'CommandSourceFormat'
246 data CommandSourceFormat
247 = CommandSourceFormat_Plain
248 | CommandSourceFormat_HTML5
250 instance Default CommandSourceFormat where
251 def = CommandSourceFormat_Plain
253 -- *** Type 'CommandSourceDump'
254 data CommandSourceDump
255 = CommandSourceDump_TCT
256 | CommandSourceDump_XML
257 deriving (Eq, Ord, Show)
259 -- ** Type 'CommandCompile'
262 { compile_output :: FilePath
263 , compile_locale :: Lang
264 , compile_dump_tct :: Bool
265 , compile_dump_xml :: Bool
266 , compile_dump_deps :: Bool
267 , compile_format :: CommandCompileFormat
268 , compile_input :: FilePath
269 -- , compile_dump :: Set CommandCompileDump
273 -- *** Type 'CommandCompileFormat'
274 data CommandCompileFormat
275 = CommandCompileFormat_HTML5
276 { compile_html5_output_css :: Maybe FilePath
277 , compile_html5_output_js :: Maybe FilePath
278 , compile_html5_dump_dtc :: Bool
280 | CommandCompileFormat_XML
284 instance Default CommandCompileFormat where
285 def = CommandCompileFormat_HTML5
286 { compile_html5_output_css = def
287 , compile_html5_output_js = def
288 , compile_html5_dump_dtc = False
291 -- *** Type 'CommandCompileDump'
292 data CommandCompileDump
293 = CommandCompileDump_TCT
294 | CommandCompileDump_XML
295 | CommandCompileDump_DTC
296 | CommandCompileDump_Deps
297 deriving (Eq, Ord, Show)
299 -- ** Type 'CommandSchema'
312 , Sym_Permutation repr
318 ) => CLI d repr where
319 cli :: Loq d -> Lang -> repr (Exit d) ArgCommand Command
320 cli loq@(Loqualization l) lang =
321 help @d (l10n_cli l) $
322 CLI.main "hdoc" $ opts **> cmds
327 <<$? option_help loq (help_usage $ cli loq lang)
328 <<|?>> option_version loq
329 <<|?>> option_license loq
331 Command_Source <$$> command_source loq <||>
332 Command_Compile <$$> command_compile loq lang <||>
333 Command_Schema <$$> command_schema loq
335 option_help :: Loq d -> d -> ((), repr (Exit d) ArgOption ())
336 option_help (Loqualization l) d =
338 help @d (l10n_help_opt_help l) $
339 opt (OptionName 'h' "help") $
341 option_version :: Loq d -> ((), repr (Exit d) ArgOption ())
342 option_version (Loqualization l) = ((),) $
343 help @d (l10n_help_version l) $
344 long "version" $ exit $ Exit_Version
345 option_license :: Loq d -> ((), repr (Exit d) ArgOption ())
346 option_license loq@(Loqualization l) = ((),) $
347 help @d (l10n_help_license l) $
348 long "license" $ exit $ Exit_License loq
350 option_input :: Loq d -> (FilePath, repr (Exit d) ArgOption FilePath)
351 option_input (Loqualization l) =
353 help @d (l10n_help_opt_input l) $
354 opt (OptionName 'i' "input") $
355 string $ l10n_var_file l
357 option_output :: Loq d -> (FilePath, repr (Exit d) ArgOption FilePath)
358 option_output (Loqualization l) =
360 help @d (l10n_help_opt_output l) $
361 opt (OptionName 'o' "output") $
362 string $ l10n_var_file l
363 option_lang :: Loq d -> Lang -> (Lang, repr (Exit d) ArgOption Lang)
364 option_lang (Loqualization l) lang =
366 help @d (l10n_help_opt_lang l) $
368 var (l10n_var_locale l) $ \s ->
369 maybe (Left $ Exit_Error $ Error_Locale s) Right $
370 Map.lookup (Text.pack s) $
372 option_dump_tct :: Loq d -> (Bool, repr (Exit d) ArgOption Bool)
373 option_dump_tct (Loqualization l) =
374 help @d (l10n_help_opt_dump_tct l) <$>
375 flag (OptionNameLong "dump-tct")
376 option_dump_xml :: Loq d -> (Bool, repr (Exit d) ArgOption Bool)
377 option_dump_xml (Loqualization l) =
378 help @d (l10n_help_opt_dump_xml l) <$>
379 flag (OptionNameLong "dump-xml")
380 option_dump_deps :: Loq d -> (Bool, repr (Exit d) ArgOption Bool)
381 option_dump_deps (Loqualization l) =
382 help @d (l10n_help_opt_dump_deps l) <$>
383 flag (OptionNameLong "dump-deps")
384 option_dump_dtc :: Loq d -> (Bool, repr (Exit d) ArgOption Bool)
385 option_dump_dtc (Loqualization l) =
386 help @d (l10n_help_opt_dump_dtc l) <$>
387 flag (OptionNameLong "dump-dtc")
389 command_source :: Loq d -> repr (Exit d) ArgCommand CommandSource
390 command_source loq@(Loqualization l) =
391 help @d (l10n_help_command_source l) $
395 <<$? option_help loq (help_usage $ command_source loq)
396 <<|?>> option_output loq
397 <<|?>> option_dump_tct loq)
398 <**> (command_source_plain loq
399 <||> command_source_html5 loq)
400 <**> string (l10n_var_file l)
401 command_source_plain :: Loq d -> repr (Exit d) ArgCommand CommandSourceFormat
402 command_source_plain loq@(Loqualization l) =
403 help @d (l10n_help_format_plain l) $
406 CommandSourceFormat_Plain
407 <<$? option_help loq (help_usage $ command_source_plain loq)
408 command_source_html5 :: Loq d -> repr (Exit d) ArgCommand CommandSourceFormat
409 command_source_html5 loq@(Loqualization l) =
410 help @d (l10n_help_format_html5 l) $
413 CommandSourceFormat_HTML5
414 <<$? option_help loq (help_usage $ command_source_html5 loq)
416 command_compile :: Loq d -> Lang -> repr (Exit d) ArgCommand CommandCompile
417 command_compile loq@(Loqualization l) lang =
418 help @d (l10n_help_command_compile l) $
423 <<$? option_help loq (help_usage $ command_compile loq lang)
424 <<|?>> option_output loq
425 <<|?>> option_lang loq lang
426 <<|?>> option_dump_tct loq
427 <<|?>> option_dump_xml loq
428 <<|?>> option_dump_deps loq)
429 <**> (command_compile_html5 loq
430 <||> command_compile_xml loq)
431 <**> string (l10n_var_file l)
433 setDefault a@CommandCompile{..}
434 | null compile_output = (a::CommandCompile){compile_output=compile_input-<.>fmt compile_format}
437 CommandCompileFormat_XML{} -> "xml"
438 CommandCompileFormat_HTML5{} -> "html"
439 command_compile_html5 :: Loq d -> repr (Exit d) ArgCommand CommandCompileFormat
440 command_compile_html5 loq@(Loqualization l) =
441 help @d (l10n_help_format_html5 l) $
444 CommandCompileFormat_HTML5
445 <<$? option_help loq (help_usage $ command_compile_html5 loq)
446 <<|?>> option_html5_output_css
447 <<|?>> option_html5_output_js
448 <<|?>> option_dump_dtc loq
450 option_html5_output_css =
453 help @d (l10n_help_opt_output_css l) $
454 opt (OptionNameLong "output-css") $
455 string $ l10n_var_file l
456 option_html5_output_js =
459 help @d (l10n_help_opt_output_js l) $
460 opt (OptionNameLong "output-js") $
461 string $ l10n_var_file l
462 command_compile_xml :: Loq d -> repr (Exit d) ArgCommand CommandCompileFormat
463 command_compile_xml loq@(Loqualization l) =
464 help @d (l10n_help_format_xml l) $
467 CommandCompileFormat_XML
468 <<$? option_help loq (help_usage $ command_compile_xml loq)
470 command_schema :: Loq d -> repr (Exit d) ArgCommand CommandSchema
471 command_schema loq@(Loqualization l) =
472 help @d (l10n_help_command_schema l) $
476 <<$? option_help loq (help_usage $ command_schema loq)
477 instance Plain.Doc d => CLI d (Plain.Plain d)
478 instance Plain.Doc d => CLI d Read.Parser
479 instance Plain.Doc d => CLI d (Help.Help d)
481 help_usage :: Plain.Doc d => Help.Help d (Exit d) t a -> d
482 help_usage = Help.textHelp Help.defReader
483 { Help.reader_command_indent = 2
484 , Help.reader_option_indent = 12
488 -- | Supported locales
489 type Langs = '[FR, EN]
490 type Lang = LocaleIn Langs
494 (\v -> Map.findWithDefault
495 (LocaleIn @Langs en_US)
496 (Text.pack $ List.takeWhile (\c -> Char.isAlphaNum c || c == '_') v)
499 <$> Env.lookupEnv "LANG"
502 type Loq d = Loqualization (L10n d)
504 class L10n_Var lang => L10n d lang where
505 l10n_cli :: FullLocale lang -> d
506 l10n_license :: FullLocale lang -> d
507 l10n_help_version :: FullLocale lang -> d
508 l10n_help_license :: FullLocale lang -> d
509 l10n_help_command_source :: FullLocale lang -> d
510 l10n_help_command_compile :: FullLocale lang -> d
511 l10n_help_command_schema :: FullLocale lang -> d
512 l10n_help_opt_lang :: FullLocale lang -> d
513 l10n_help_opt_output :: FullLocale lang -> d
514 l10n_help_opt_output_css :: FullLocale lang -> d
515 l10n_help_opt_output_js :: FullLocale lang -> d
516 l10n_help_opt_dump_tct :: FullLocale lang -> d
517 l10n_help_opt_dump_xml :: FullLocale lang -> d
518 l10n_help_opt_dump_deps :: FullLocale lang -> d
519 l10n_help_opt_dump_dtc :: FullLocale lang -> d
520 l10n_help_format :: FullLocale lang -> d
521 l10n_help_format_plain :: FullLocale lang -> d
522 l10n_help_format_html5 :: FullLocale lang -> d
523 l10n_help_format_xml :: FullLocale lang -> d
524 l10n_help_opt_input :: FullLocale lang -> d
525 l10n_help_opt_help :: FullLocale lang -> d
526 class L10n_Var lang where
527 l10n_var_file :: FullLocale lang -> Name
528 l10n_var_locale :: FullLocale lang -> Name
535 instance (Semigroup d, IsString d) => Semigroup (Doc d) where
536 Doc x <> Doc y = Doc (x<>y)
537 x <> y = Doc $ runDoc x <> runDoc y
538 instance (Semigroup d, Monoid d, IsString d) => Monoid (Doc d) where
541 instance Doc.Breakable d => IsString (Doc d) where
542 fromString = Doc . Plain.words
543 instance (IsString d, Semigroup d, Monoid d) => IsList (Doc d) where
544 type Item (Doc d) = Doc d
546 fromList = Doc . foldMap runDoc
547 instance (IsString d, Semigroup d) => Doc.Trans (Doc d) where
548 type ReprOf (Doc d) = d
551 instance Doc.Breakable d => Doc.Textable (Doc d)
552 instance (Doc.Breakable d, Doc.Indentable d) => Doc.Indentable (Doc d)
553 instance Doc.Breakable d => Doc.Breakable (Doc d)
554 instance (IsString d, Semigroup d, Doc.Decorable d) => Doc.Decorable (Doc d)
555 instance (IsString d, Semigroup d, Doc.Colorable d) => Doc.Colorable (Doc d)
556 instance Plain.Doc d => Plain.Doc (Doc d)
558 runDoc :: (IsString d, Semigroup d) => Doc d -> d
561 Var n -> "<"<>fromString n<>">"
563 instance (IsString d, Semigroup d, Monoid d, Doc.Breakable d) => L10n (Doc d) EN where
564 l10n_cli _ = "Compiler of Convivial Technical Document (DTC)."
567 List.intercalate "\n"
568 [ "License: GNU GPLv3+"
569 , "Copyright: Julien Moutinho <julm+hdoc@autogeree.net>"
571 , "hdoc is free software: you can redistribute it and/or modify it"
572 , "under the terms of the GNU General Public License (GPL)"
573 , "as published by the Free Software Foundation;"
574 , "either in version 3, or (at your option) any later version."
576 , "hdoc is distributed in the hope that it will be useful,"
577 , "but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY"
578 , "or FITNESS FOR A PARTICULAR PURPOSE."
580 , "See the GNU GPL for more details."
581 , "You should have received a copy of the GNU GPL along with hdoc."
582 , "If not, see: http://www.gnu.org/licenses/"
584 l10n_help_version _ = "Show the version of this program."
585 l10n_help_license _ = "Inform about the license of this program."
586 l10n_help_command_source _ = "Format the source code of a TCT document."
587 l10n_help_command_compile _ = "Compile a TCT document into a format optimized for reading."
588 l10n_help_command_schema _ = "Show in RNC (RelaxNG Compact) format the XML schema of the DTC format."
589 l10n_help_opt_lang l = ["Use the language given by ", Var $ l10n_var_locale l, "."]
590 l10n_help_opt_output l = ["Output document into ", Var $ l10n_var_file l]
591 l10n_help_opt_output_css l = [ "Output CSS stylesheet into "
592 , Var $ l10n_var_file l
593 , " (if any), instead of incorporating it into the HTML."
595 l10n_help_opt_output_js l = [ "Output JavaScript script into "
596 , Var $ l10n_var_file l
597 , " (if any), instead of incorporating it into the HTML."
599 l10n_help_opt_dump_tct l = [ "Dump internal TCT representation of "
600 , Var $ l10n_var_file l,".tct file,"
602 , Var $ l10n_var_file l,".tct.dump file."
604 l10n_help_opt_dump_xml l = [ "Dump internal XML representation of "
605 , Var $ l10n_var_file l,".tct file,"
607 , Var $ l10n_var_file l,".xml.dump file."
609 l10n_help_opt_dump_deps l = [ "Dump dependencies of ", Var $ l10n_var_file l,".tct file"
610 , " in ", Var $ l10n_var_file l,".deps file,"
611 , " separated by newlines."
613 l10n_help_opt_dump_dtc _ = "Dump internal representation of DTC."
614 l10n_help_opt_help _ = "Show this help."
615 l10n_help_format _ = "Output format."
616 l10n_help_format_plain _ = "Output as plain text."
617 l10n_help_format_html5 _ = "Output as HTML5."
618 l10n_help_format_xml _ = "Output as XML."
619 l10n_help_opt_input l = ["Read input from ", Var $ l10n_var_file l, "."]
620 instance (IsString d , Semigroup d, Monoid d, Doc.Breakable d) => L10n (Doc d) FR where
621 l10n_cli _ = "Compilateur de Document Technique Convivial (DTC)."
624 List.intercalate "\n"
625 [ "Licence : GPLv3+ GNU"
626 , "Droit d’auteur : Julien Moutinho <julm+hdoc@autogeree.net>"
628 , "hdoc est un logiciel libre : vous pouvez le redistribuer et/ou le modifier"
629 , "selon les termes de la Licence Publique Générale (GPL) GNU"
630 , "telle que publiée par la Free Software Foundation ;"
631 , "en version 3, ou (à votre choix) n’importe quelle version ultérieure."
633 , "hdoc est distribué dans l’espoir qu’il sera utile,"
634 , "mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION"
635 , "ou de CONVENANCE À UN BUT PARTICULIER."
637 , "Voyez la GPL pour davantage de détails."
638 , "Vous devriez avoir reçu une copie de la GPL avec hdoc."
639 , "Si non, voyez : http://www.gnu.org/licenses/"
641 l10n_help_version _ = "Affiche la version de ce logiciel."
642 l10n_help_license _ = "Informe sur la licence de ce logiciel."
643 l10n_help_command_source _ = "Lit un document TCT et écrit un rendu préservant sa syntaxe."
644 l10n_help_command_compile _ = "Compile un document TCT vers un format optimisé pour la lecture."
645 l10n_help_command_schema _ = "Affiche au format RNC (RelaxNG Compact) le schéma XML du format DTC."
646 l10n_help_opt_lang l = ["Utilise le langage indiqué par ", Var $ l10n_var_locale l, "."]
647 l10n_help_opt_output l = ["Écrit dans ", Var $ l10n_var_file l, "."]
648 l10n_help_opt_output_css l = [ "Écrit la feuille de style CSS dans "
649 , Var $ l10n_var_file l
650 , ", au lieu de l’incorporer dans le HTML."
652 l10n_help_opt_output_js l = [ "Écrit le script JavaScript dans "
653 , Var $ l10n_var_file l
654 , ", au lieu de l’incorporer dans le HTML."
656 l10n_help_opt_dump_tct l = [ "Écrit la représentation TCT interne de "
657 , Var $ l10n_var_file l,".tct,"
659 , Var $ l10n_var_file l,".tct.dump."
661 l10n_help_opt_dump_xml l = [ "Écrit la représentation XML interne de "
662 , Var $ l10n_var_file l,".tct,"
664 , Var $ l10n_var_file l,".xml.dump."
666 l10n_help_opt_dump_deps l = [ "Écrit les dépendences de ", Var $ l10n_var_file l,".tct"
667 , " dans ", Var $ l10n_var_file l,".deps,"
668 , " séparées par des retours à la ligne."
670 l10n_help_opt_dump_dtc _ = "Écrit la représentation interne du DTC."
671 l10n_help_opt_help _ = "Affiche cette aide."
672 l10n_help_format _ = "Format de sortie."
673 l10n_help_format_plain _ = "Produit du texte brut."
674 l10n_help_format_html5 _ = "Produit du HTML5."
675 l10n_help_format_xml _ = "Produit du XML."
676 l10n_help_opt_input l = ["Lit depuis ", Var $ l10n_var_file l, "."]
677 instance L10n_Var EN where
678 l10n_var_file _ = "file"
679 l10n_var_locale _ = "locale"
680 instance L10n_Var FR where
681 l10n_var_file _ = "fichier"
682 l10n_var_locale _ = "locale"