Skip to content

Commit

Permalink
Rewrite stylesheets
Browse files Browse the repository at this point in the history
This completely rewrites all of the stylesheets, and adds a hard
division between version 7 and version 8 of the schema.

Affects: #13
  • Loading branch information
io7m committed Jul 4, 2021
1 parent acc40c5 commit 274ce78
Show file tree
Hide file tree
Showing 132 changed files with 9,703 additions and 4,364 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -155,7 +155,14 @@ enum Task
* The input document will be transformed to an EPUB.
*/

TRANSFORM_EPUB
TRANSFORM_EPUB,

/**
* The input XHTML will be validated, and no other steps will be
* performed.
*/

VALIDATE_XHTML,
}

/**
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -0,0 +1,80 @@
/*
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

package com.io7m.xstructural.api;

import java.net.URI;
import java.util.Set;

/**
* The known structural schemas.
*/

public final class XSSchemas
{
private XSSchemas()
{

}

/**
* @return The set of known structural schemas
*/

public static Set<URI> namespaces()
{
return Set.of(
namespace7p0(),
namespace8p0()
);
}

/**
* @return The structural 7.0 schema
*/

public static URI namespace7p0()
{
return URI.create("urn:com.io7m.structural:7:0");
}

/**
* @return The structural 7.0 schema
*/

public static String namespace7p0s()
{
return namespace7p0().toString();
}

/**
* @return The structural 8.0 schema
*/

public static URI namespace8p0()
{
return URI.create("urn:com.io7m.structural:8:0");
}

/**
* @return The structural 8.0 schema
*/

public static String namespace8p0s()
{
return namespace8p0().toString();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.api/src/main/java/module-info.java
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -53,6 +53,7 @@ public Main(

final XSCommandRoot r = new XSCommandRoot();
final var validate = new XSCommandValidate();
final var validateXhtml = new XSCommandValidateXHTML();
final var xhtml = new XSCommandTransformXHTML();
final var epub = new XSCommandTransformEPUB();
final var schema = new XSCommandSchema();
Expand All @@ -61,13 +62,15 @@ public Main(
this.commands.put("epub", epub);
this.commands.put("schema", schema);
this.commands.put("validate", validate);
this.commands.put("validate-xhtml", validateXhtml);
this.commands.put("xhtml", xhtml);

this.commander = new JCommander(r);
this.commander.setProgramName("xstructural");
this.commander.addCommand("epub", epub);
this.commander.addCommand("schema", schema);
this.commander.addCommand("validate", validate);
this.commander.addCommand("validate-xhtml", validateXhtml);
this.commander.addCommand("xhtml", xhtml);
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -0,0 +1,71 @@
/*
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

package com.io7m.xstructural.cmdline;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.io7m.xstructural.api.XSProcessorRequest;
import com.io7m.xstructural.cmdline.internal.XSServices;

import java.nio.file.Files;
import java.nio.file.Path;

import static com.io7m.xstructural.api.XSProcessorRequestType.Task;

@Parameters(commandDescription = "Validate an XHTML document")
final class XSCommandValidateXHTML extends XSCommandRoot
{
@Parameter(
required = true,
description = "The source directory",
names = "--sourceDirectory"
)
private Path sourceDirectory;

XSCommandValidateXHTML()
{

}

@Override
public Status execute()
throws Exception
{
if (super.execute() == Status.FAILURE) {
return Status.FAILURE;
}

final var directory = Files.createTempDirectory("xstructural-");
Files.deleteIfExists(directory);

final var tempFile = Files.createTempFile("xstructural", ".tmp");
try {
final var requestBuilder = XSProcessorRequest.builder();
requestBuilder.setOutputDirectory(this.sourceDirectory.toAbsolutePath());
requestBuilder.setSourceFile(tempFile);
requestBuilder.setTask(Task.VALIDATE_XHTML);

final var request = requestBuilder.build();
final var processors = XSServices.findProcessors();
final var processor = processors.create(request);
processor.execute();
return Status.SUCCESS;
} finally {
Files.deleteIfExists(tempFile);
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com
* Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.documentation/pom.xml
Expand Up @@ -174,7 +174,7 @@
<excludes>module-info.java</excludes>
<includes>
com/io7m/xstructural/xml/xstructural-7.xsd,
com/io7m/xstructural/xml/xstructural-7_1.xsd
com/io7m/xstructural/xml/xstructural-8.xsd
</includes>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>com.io7m.xstructural.xml</includeArtifactIds>
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Section xmlns="urn:com.io7m.structural:7:0" title="API">
<Section xmlns="urn:com.io7m.structural:8:0" title="API">
<Subsection title="Usage">
<FormalItem title="Usage">
<Verbatim><![CDATA[
Expand Down

0 comments on commit 274ce78

Please sign in to comment.