agda-web-docs-lib
Version:
Library for enhancing Agda-generated HTML documentation
62 lines (61 loc) • 1.71 kB
TypeScript
import { AgdaDocsConfig } from './types';
export declare class AgdaDocsTransformer {
private config;
private dom;
private currentFile;
constructor(config: AgdaDocsConfig);
/**
* Sets the HTML content to transform
*/
setContent(content: string, filename?: string): void;
/**
* Transforms the HTML with custom navigation
*/
transform(): string;
/**
* Adds search functionality to the page
*/
private addSearchFunctionality;
/**
* Transforms Agda-generated numeric position references to line number references
* so that they work with the line highlighting feature
*/
private transformAgdaLinks;
/**
* Attempts to find which code block contains the specified position
* For literate Agda files where there are multiple code blocks
*/
private findCodeBlockContainingPosition;
/**
* Determines if the given file path refers to the current file
*/
private isCurrentFile;
/**
* Adds line numbers to Agda code blocks
*/
private addLineNumbersToCodeBlocks;
/**
* Adds a script to initialize the theme before content loads
*/
private addThemeInitScript;
/**
* Adds the CSS styles to the document
*/
private addStyles;
/**
* Adds the custom header with optional back button
*/
private addHeader;
/**
* Checks if a module should be included in the sidebar
*/
private shouldIncludeModule;
/**
* Adds the sidebar with modules
*/
private addSidebar;
/**
* Adds the preview container and script for type hover functionality
*/
private addTypePreviewContainer;
}