-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(parser): preprocess file inclusions
start with a first pass of parsing the document to detect file inclusions and process accordingly (inclusing applying the level offsets on sections when needed) Signed-off-by: Xavier Coulon <[email protected]>
- Loading branch information
Showing
23 changed files
with
50,094 additions
and
41,569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package parser | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/bytesparadise/libasciidoc/pkg/configuration" | ||
) | ||
|
||
// Preprocess reads line by line to look-up and process file inclusions | ||
func Preprocess(source io.Reader, config *configuration.Configuration, opts ...Option) (string, error) { | ||
ctx := NewParseContext(config, opts...) // each pipeline step will have its own clone of `ctx` | ||
return processFileInclusions(ctx, source) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.