private void ensureLocalDocumentationLoaded(Path documentationPath) throws IOException {
        File dir = new File(documentationPath.resolve("schema").toString());
        File[] contents = dir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.getName().endsWith(".md");
            }
        });
        // Documentation exists
        if (contents.length > 0) return;

        logger.info("Extracting embedded documentation files.");

        // If it doesn't exist, unpack from jar
        var resources = Thread.currentThread().getContextClassLoader().getResources(documentationPath.getFileName().toString());

        if (!resources.hasMoreElements()) {
            throw new IOException("Could not find documentation in jar file!");
        }

        URL resourceURL = resources.nextElement();

        if (!resourceURL.getProtocol().equals("jar")) {
            throw new IOException("Unhandled protocol for resource " +  resourceURL.toString());
        }

        String jarPath = resourceURL.getPath().substring(5, resourceURL.getPath().indexOf('!'));
        try (JarFile jarFile = new JarFile(URLDecoder.decode(jarPath, "UTF-8"))) {
            Enumeration<JarEntry> entries = jarFile.entries();
            while (entries.hasMoreElements()) {
                JarEntry entry = entries.nextElement();
                if (!entry.isDirectory() && entry.getName().startsWith(documentationPath.getFileName().toString())) {
                    Path destination = documentationPath.getParent().resolve(entry.getName());
                    Files.createDirectories(destination.getParent());
                    try (InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(entry.getName())) {
                        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
                        String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
                        Files.write(destination, content.getBytes(), StandardOpenOption.CREATE);
                    }
                }
            }
        }
    }
Assumes documentation is loaded if documentationPath/schema contains .md files.
If documentation is not loaded, unpacks markdown files from the current jar.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/SchemaLanguageServer.java