<commit_before>//
// Copyright 2016, Yahoo Inc.
// Copyrights licensed under the New BSD License.
// See the accompanying LICENSE file for terms.
//

// Package description.
package github.com.ricallinson.jmmdoc;

import github.com.ricallinson.jmmmarkdown.Markdown;
import github.com.ricallinson.http.Server;

// Class description.
public class Doc {

    // Public method description with inline markdown.
    // 
    // Print the documentation for a given class path file.
    //
    // ### Usage
    //
    // `jmmdoc [class_path]`
    //
    // ```
    // $ jmmdoc github.com.ricallinson.jmmdoc.Doc
    // ```
    public static void main(String[] args) {
        Doc doc = new Doc();
        if (args.length == 1) {
            System.out.println("");
            System.out.println(doc.getDoc(args[0]).trim());
            System.out.println("");
            return;
        }
        doc.startServer(8080);
    }

    // The current JMM working directory.
    protected final String workingDir = System.getenv("JMMPATH");
    
    // Line Feed.
    protected static final byte LF = (byte)10;

    // Carrage return, line feed.
    protected static final String CRLF = "\r\n";

    // Public method description.
    // Start HTTP server for docs.
    public void startServer(int port) {
        Server s = Server.createServer((req, res) -> {
            String classPath = req.url.substring(1).replace("/", ".");
            String md;
            if (classPath.length() > 0) {
                md = this.getDoc(classPath);
            } else {
                md = this.toString();
            }
            res.setHeader("Content", "text/html");
            // Replace this with handlebars.
            res.end("<html><head>" + this.getCss() + "</head><body>" + this.getMenu() + "<div class=\"content\">" + Markdown.parse(md).toString() + "</div></body></html>");
        });
        s.listen(port);
        System.out.println("Document server started on port 8080");
        System.out.println("Serving documentation from " + this.workingDir);
    }

    // Public method description.<commit_msg>Changed starting output to have url<commit_after>//
// Copyright 2016, Yahoo Inc.
// Copyrights licensed under the New BSD License.
// See the accompanying LICENSE file for terms.
//

// Package description.
package github.com.ricallinson.jmmdoc;

import github.com.ricallinson.jmmmarkdown.Markdown;
import github.com.ricallinson.http.Server;

// Class description.
public class Doc {

    // Public method description with inline markdown.
    // 
    // Print the documentation for a given class path file.
    //
    // ### Usage
    //
    // `jmmdoc [class_path]`
    //
    // ```
    // $ jmmdoc github.com.ricallinson.jmmdoc.Doc
    // ```
    public static void main(String[] args) {
        Doc doc = new Doc();
        if (args.length == 1) {
            System.out.println("");
            System.out.println(doc.getDoc(args[0]).trim());
            System.out.println("");
            return;
        }
        doc.startServer(8080);
    }

    // The current JMM working directory.
    protected final String workingDir = System.getenv("JMMPATH");
    
    // Line Feed.
    protected static final byte LF = (byte)10;

    // Carrage return, line feed.
    protected static final String CRLF = "\r\n";

    // Public method description.
    // Start HTTP server for docs.
    public void startServer(int port) {
        Server s = Server.createServer((req, res) -> {
            String classPath = req.url.substring(1).replace("/", ".");
            String md;
            if (classPath.length() > 0) {
                md = this.getDoc(classPath);
            } else {
                md = this.toString();
            }
            res.setHeader("Content", "text/html");
            // Replace this with handlebars.
            res.end("<html><head>" + this.getCss() + "</head><body>" + this.getMenu() + "<div class=\"content\">" + Markdown.parse(md).toString() + "</div></body></html>");
        });
        s.listen(port);
        System.out.println("Document server started at http://localhost:8080/");
        System.out.println("Serving documentation from " + this.workingDir);
    }

    // Public method description.
{'fraction_non_alphanumeric': 0.1454845555293563, 'fraction_numerical': 0.008488564017920301, 'mean_word_length': 2.043041606886657, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2661878', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1187, 'n_words': 311}