Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api_refs[major]: Remove script, use custom typedoc plugin #3630

Merged
merged 11 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cr
bracesproul committed Dec 12, 2023
commit 4269ac2d4758bf160245ae9d587f8104c8df7ed6
104 changes: 67 additions & 37 deletions docs/api_refs/typedoc_plugins/hide_underscore_lc.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,70 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
var typedoc_1 = require("typedoc");
const {
Application,
Converter,
Context,
ReflectionKind,
DeclarationReflection,
} = require("typedoc");

/**
* @param {Application} application
* @returns {void}
*/
function load(application) {
var reflections = [];
application.converter.on(typedoc_1.Converter.EVENT_CREATE_DECLARATION, resolveReflection);
application.converter.on(typedoc_1.Converter.EVENT_RESOLVE_BEGIN, onBeginResolve);
var reflectionKindsToHide = [
typedoc_1.ReflectionKind.Property,
typedoc_1.ReflectionKind.Accessor,
typedoc_1.ReflectionKind.Variable,
typedoc_1.ReflectionKind.Method,
typedoc_1.ReflectionKind.Function,
typedoc_1.ReflectionKind.Class,
typedoc_1.ReflectionKind.Interface,
typedoc_1.ReflectionKind.Enum,
typedoc_1.ReflectionKind.TypeAlias,
];
function onBeginResolve(context) {
reflections.forEach(function (reflection) {
var project = context.project;
console.log("deleting", reflection.name);
// Remove the property from documentation
project.removeReflection(reflection);
});
}
function resolveReflection(context, reflection) {
var reflectionKind = reflection.kind;
// if (reflection.kindOf(ReflectionKind.Property)) {
if (reflectionKindsToHide.includes(reflectionKind)) {
if (reflection.name.startsWith("_") ||
reflection.name.startsWith("lc_")) {
reflections.push(reflection);
console.log("found lc or underscore", reflection.name);
}
}
/**
* @type {Array<DeclarationReflection>}
*/
let reflections = [];
application.converter.on(
Converter.EVENT_CREATE_DECLARATION,
resolveReflection
);
application.converter.on(Converter.EVENT_RESOLVE_BEGIN, onBeginResolve);

const reflectionKindsToHide = [
ReflectionKind.Property,
ReflectionKind.Accessor,
ReflectionKind.Variable,
ReflectionKind.Method,
ReflectionKind.Function,
ReflectionKind.Class,
ReflectionKind.Interface,
ReflectionKind.Enum,
ReflectionKind.TypeAlias,
];

/**
* @param {Context} context
* @returns {void}
*/
function onBeginResolve(context) {
reflections.forEach((reflection) => {
const { project } = context;
// Remove the property from documentation
project.removeReflection(reflection);
});
}

/**
* @param {Context} _context
* @param {DeclarationReflection} reflection
* @returns {void}
*/
function resolveReflection(
_context,
reflection
) {
const reflectionKind = reflection.kind;
// if (reflection.kindOf(ReflectionKind.Property)) {
if (reflectionKindsToHide.includes(reflectionKind)) {
if (
reflection.name.startsWith("_") ||
reflection.name.startsWith("lc_")
) {
reflections.push(reflection);
}
}
}
}
exports.load = load;

module.exports = { load };
54 changes: 0 additions & 54 deletions docs/api_refs/typedoc_plugins/hide_underscore_lc.ts

This file was deleted.